summaryrefslogtreecommitdiff
path: root/drivers/vme
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2017-12-12 20:51:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-18 15:59:18 +0100
commit97784615ed32c1ef33047e95d4240141258e2cf0 (patch)
treeadd904df57c13e4223eefad1bd601c3a50706471 /drivers/vme
parentde2ee48c39b6af95121b33c6c5531e0475e12a3a (diff)
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>
Diffstat (limited to 'drivers/vme')
-rw-r--r--drivers/vme/vme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index 81246221a13b..92500f6bdad1 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -1290,7 +1290,7 @@ struct vme_error_handler *vme_register_error_handler(
{
struct vme_error_handler *handler;
- handler = kmalloc(sizeof(*handler), GFP_KERNEL);
+ handler = kmalloc(sizeof(*handler), GFP_ATOMIC);
if (!handler)
return NULL;