]> git.baikalelectronics.ru Git - kernel.git/commit
staging: vboxvideo: Cleanup vbox_set_up_input_mapping()
authorHans de Goede <hdegoede@redhat.com>
Sat, 29 Sep 2018 12:18:11 +0000 (14:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Sep 2018 12:31:32 +0000 (05:31 -0700)
commitba0b5727d15ace42878b824d87f9be490bc09cd3
treeefe7a49049d3d7043b9e86c4e9e0a6ff426ebae6
parentf685f8b7991d51fc5eebe16aa8a22f70de8e3e0e
staging: vboxvideo: Cleanup vbox_set_up_input_mapping()

This cleanups 2 things:

1) The first time we loop over the crtc-s, to compare framebuffers, fb1 may
get set to NULL by the fb1 = CRTC_FB(crtci); statement and then we call
to_vbox_framebuffer() on it. The result of this call is only used for
an address comparison, so we don't end up dereferencing the bad pointer,
but still it is better to not do this.

2) Since we already figure out the first crtc with a fb in the first loop
and store that in fb1, there is no need to loop over the crtc-s again just
to find the first crtc with a fb again.

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