linux/drivers/media/platform/sti
Jia-Ju Bai fc3c0fc85d media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run()
[ Upstream commit bb6d42061a ]

The driver may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:

drivers/media/platform/sti/bdisp/bdisp-hw.c, 385:
    msleep in bdisp_hw_reset
drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 341:
    bdisp_hw_reset in bdisp_device_run
drivers/media/platform/sti/bdisp/bdisp-v4l2.c, 317:
    _raw_spin_lock_irqsave in bdisp_device_run

To fix this bug, msleep() is replaced with udelay().

This bug is found by a static analysis tool STCheck written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:36:26 +01:00
..
bdisp media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run() 2020-02-24 08:36:26 +01:00
c8sectpfe media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
cec media: stih-cec: use cec_notifier_cec_adap_(un)register 2019-07-23 08:40:00 -04:00
delta treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hva media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00