aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDu Cheng <ducheng2@gmail.com>2021-03-12 16:14:21 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 14:47:44 +0200
commitcde4e338c2b2dda998dd480ecf9df55a1624820d (patch)
tree67035df852f666de6f0597f5c432cd2b2fc6d887
parent0ca13611d33fe3bd442973e5250b0d665d832d9e (diff)
downloadlinux-yocto-cde4e338c2b2dda998dd480ecf9df55a1624820d.tar.gz
linux-yocto-cde4e338c2b2dda998dd480ecf9df55a1624820d.tar.bz2
linux-yocto-cde4e338c2b2dda998dd480ecf9df55a1624820d.zip
drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
commit 01faae5193d6190b7b3aa93dae43f514e866d652 upstream. add null-check on function pointer before dereference on ops->cursor Reported-by: syzbot+b67aaae8d3a927f68d20@syzkaller.appspotmail.com Cc: stable <stable@vger.kernel.org> Signed-off-by: Du Cheng <ducheng2@gmail.com> Link: https://lore.kernel.org/r/20210312081421.452405-1-ducheng2@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/video/fbdev/core/fbcon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 4cf71ee0965a..0a9202176ffc 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1339,6 +1339,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
+ if (!ops->cursor)
+ return;
+
ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
get_color(vc, info, c, 0));
}