]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gma500: fix a potential repeat execution in psb_driver_load
authorXiaomeng Tong <xiam0nd.tong@gmail.com>
Wed, 13 Apr 2022 05:11:05 +0000 (13:11 +0800)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 20 Apr 2022 07:11:01 +0000 (09:11 +0200)
commit3ab812b8fed18a9d7ef7b2ed328fc4c4ce07e17a
treefd67da1d8d5cc9271b4cb80b04c54988fada4d6c
parent5dff3780769051c2eece28bdec8e4413968b6298
drm/gma500: fix a potential repeat execution in psb_driver_load

Instead of exiting the loop as expected when an entry is found, the
list_for_each_entry() continues until the traversal is complete. To
avoid potential executing 'ret = gma_backlight_init(dev);' repeatly,
goto outside the loop when found entry by replacing switch/case with
if statement.

Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
[Fixed indentation]
Link: https://patchwork.freedesktop.org/patch/msgid/20220413051105.5612-1-xiam0nd.tong@gmail.com
drivers/gpu/drm/gma500/psb_drv.c