All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
@ 2021-03-12  8:14 Du Cheng
  2021-03-12  8:36 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Du Cheng @ 2021-03-12  8:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Daniel Vetter, syzbot+b67aaae8d3a927f68d20, dri-devel, Du Cheng

add null-check on function pointer before dereference on ops->cursor

Reported-by: syzbot+b67aaae8d3a927f68d20@syzkaller.appspotmail.com
Signed-off-by: Du Cheng <ducheng2@gmail.com>
---
 drivers/video/fbdev/core/fbcon.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 44a5cd2f54cc..3406067985b1 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1333,6 +1333,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));
 }
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-13  0:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-12  8:14 [PATCH] drivers: video: fbcon: fix NULL dereference in fbcon_cursor() Du Cheng
2021-03-12  8:36 ` Greg Kroah-Hartman
2021-03-12  9:13   ` Du Cheng
2021-03-13  0:23   ` Du Cheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.