]> 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)
commita92ec6a5dec0d3cbfb154d4d8853260d7268c705
treeefe7a49049d3d7043b9e86c4e9e0a6ff426ebae6
parent6ba5c0208b58431bd3db16ca48a22f69c6e6acba
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