diff options
author | 2017-12-12 21:24:56 +0800 | |
---|---|---|
committer | 2017-12-15 20:24:14 +0100 | |
commit | fe8e7acea2426dcd1130fd5c9710b74217c90dd0 (patch) | |
tree | 865a507d64c1ba033fe1d994bd1ee0552d77cb92 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | tty: serial: sh-sci: Hide DMA config question (diff) | |
download | wireguard-linux-fe8e7acea2426dcd1130fd5c9710b74217c90dd0.tar.xz wireguard-linux-fe8e7acea2426dcd1130fd5c9710b74217c90dd0.zip |
tty/isicom: Fix a possible sleep-in-atomic bug in WaitTillCardIsFree
The driver may sleep under a spinlock.
The function call paths are:
isicom_activate (acquire the spinlock)
isicom_setup_board
drop_dtr_rts
WaitTillCardIsFree
msleep --> may sleep
isicom_set_termios
isicom_config_port
drop_dtr
WaitTillCardIsFree
msleep --> may sleep
isicom_tiocmset
drop_dtr
WaitTillCardIsFree
msleep --> may sleep
Though "in_atomic" is used to check atomic context,
but it is not recommended to use in driver code (see include/linux/preempt.h).
To fix it, only using mdelay instead.
This bug is found by my static analysis tool(DSAC) and checked by my code review.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions