summaryrefslogtreecommitdiff
path: root/drivers/scsi/megaraid/megaraid_mm.c
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2017-05-31 05:56:56 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-06-13 03:48:08 +0300
commit896f6966fc815abe71f85fb26f0193875df8a035 (patch)
tree6c1c0027740f63c5346c360a974d3934474638e4 /drivers/scsi/megaraid/megaraid_mm.c
parent566ec9ad315b46e7056472f4cd1d1b79bbad62da (diff)
downloadlinux-896f6966fc815abe71f85fb26f0193875df8a035.tar.xz
scsi: megaraid: Fix a sleep-in-atomic bug
The driver may sleep under a spin lock, and the function call path is: mraid_mm_attach_buf (acquire the lock by spin_lock_irqsave) pci_pool_alloc(GFP_KERNEL) --> may sleep To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC". [mkp: fixed whitespace] Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_mm.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_mm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index 4cf9ed96414f..544d6f7e6138 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -574,7 +574,7 @@ mraid_mm_attach_buf(mraid_mmadp_t *adp, uioc_t *kioc, int xferlen)
kioc->pool_index = right_pool;
kioc->free_buf = 1;
- kioc->buf_vaddr = pci_pool_alloc(pool->handle, GFP_KERNEL,
+ kioc->buf_vaddr = pci_pool_alloc(pool->handle, GFP_ATOMIC,
&kioc->buf_paddr);
spin_unlock_irqrestore(&pool->lock, flags);