]> git.baikalelectronics.ru Git - kernel.git/commit
drm/client: Restrict the plane_state scope
authorMaxime Ripard <maxime.ripard@bootlin.com>
Wed, 19 Jun 2019 10:17:48 +0000 (12:17 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Wed, 19 Jun 2019 10:17:48 +0000 (12:17 +0200)
commit5d99a653689da6f8fdf06f4f3adbe661f918f1dd
tree2436a987056c7407893497eafc496c946c7b1ac8
parent02eaf67f41f4acc7131e29e23494ea507c9ca12c
drm/client: Restrict the plane_state scope

The drm_client_modeset_commit_atomic function uses two times the
plane_state variable in inner blocks of code, but the variable has a scope
global to this function.

This will lead to inadvertent devs to reuse the variable in the second
block with the value left by the first, without any warning from the
compiler since value would have been initialized.

Fix this by moving the variable declaration to the proper scope.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8bd9696ea915a4ad08be6d93a4d9565e8d6aa2f3.1560783090.git-series.maxime.ripard@bootlin.com
drivers/gpu/drm/drm_client_modeset.c