Skip to content
Commit bb6d4206 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Mauro Carvalho Chehab
Browse files

media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run()



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: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 11c48e41
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment