staging: vboxvideo: Fix NULL ptr deref in vbox_set_up_input_mapping()
authorHans de Goede <hdegoede@redhat.com>
Tue, 18 Sep 2018 17:44:36 +0000 (19:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Sep 2018 10:32:05 +0000 (12:32 +0200)
commit114094c83ed334524ee1a50bd8c08425f361148b
treeefa6b974501666df434fcdae928002f6b4776831
parent0fdda2ce74e5fe2d9ff813895fcf0f716be66290
staging: vboxvideo: Fix NULL ptr deref in vbox_set_up_input_mapping()

When vbox_set_up_input_mapping() gets called the first crtc might be
disable and not have a fb at all, triggering a NUL ptr deref at:

vbox->input_mapping_width = CRTC_FB(crtci)->width;

Instead of using the fb from the crtc with id 0, just use the fb from
the first crtc with a fb. This is in the single_framebuffer = true path,
so all crtc-s point to the same fb anyways.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vboxvideo/vbox_mode.c