mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
vme: Fix a possible sleep-in-atomic bug in vme_tsi148
The driver may sleep under a spinlock. The function call path is: tsi148_master_write \ tsi148_master_read (acquire the spinlock) vme_register_error_handler kmalloc(GFP_KERNEL) --> may sleep To fix it, GFP_KERNEL is replaced with GFP_ATOMIC. 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>
This commit is contained in:
parent
de2ee48c39
commit
97784615ed
1 changed files with 1 additions and 1 deletions
|
@ -1290,7 +1290,7 @@ struct vme_error_handler *vme_register_error_handler(
|
||||||
{
|
{
|
||||||
struct vme_error_handler *handler;
|
struct vme_error_handler *handler;
|
||||||
|
|
||||||
handler = kmalloc(sizeof(*handler), GFP_KERNEL);
|
handler = kmalloc(sizeof(*handler), GFP_ATOMIC);
|
||||||
if (!handler)
|
if (!handler)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue