scsi: be2iscsi: Use GFP_ATOMIC under spin lock
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 12 Jan 2017 14:21:32 +0000 (14:21 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Jan 2017 21:57:48 +0000 (16:57 -0500)
A spin lock is taken here so we should use GFP_ATOMIC.

Fixes: 987132167f4b ("scsi: be2iscsi: Fix for crash in beiscsi_eh_device_reset")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/be2iscsi/be_main.c

index 6372613e7516a5317d1aa27c81da04be77b26ca8..c9b9daa910911474f8f36543d6ddcb1c25dd30ff 100644 (file)
@@ -294,7 +294,7 @@ static int beiscsi_eh_device_reset(struct scsi_cmnd *sc)
        beiscsi_conn = conn->dd_data;
        phba = beiscsi_conn->phba;
 
-       inv_tbl = kzalloc(sizeof(*inv_tbl), GFP_KERNEL);
+       inv_tbl = kzalloc(sizeof(*inv_tbl), GFP_ATOMIC);
        if (!inv_tbl) {
                spin_unlock_bh(&session->frwd_lock);
                beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH,