Skip to content

Commit

Permalink
drivers: video: fbcon: fix NULL dereference in fbcon_cursor()
Browse files Browse the repository at this point in the history
commit 01faae5 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>
  • Loading branch information
Du Cheng authored and Greg Kroah-Hartman committed Apr 7, 2021
1 parent 9e7a663 commit 4095574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,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));
}
Expand Down

0 comments on commit 4095574

Please sign in to comment.