diff mbox

qla2xxx: Fix memory corruption during hba reset test

Message ID 20180123190521.11382-1-himanshu.madhani@cavium.com (mailing list archive)
State Accepted
Headers show

Commit Message

Madhani, Himanshu Jan. 23, 2018, 7:05 p.m. UTC
From: Quinn Tran <quinn.tran@cavium.com>

This patch fixes memory corrpution while performing
HBA Reset test.

Following stack trace is seen

[  466.397219] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
[  466.433669] IP: [<ffffffffc06f5dd0>] qlt_free_session_done+0x260/0x5f0 [qla2xxx]
[  466.467731] PGD 0
[  466.476718] Oops: 0000 [#1] SMP

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
Hi Martin, 

This patch fixes the crash for HBA reset test. From core dump analysis,
memory corruption was discoverd during session cleanup. To prevent this
memory corruption, driver needs to wait for session to be deleted and 
all memory associated with the session released before it can relogin and 
create new session.

Please apply this patch to 4.16/scsi-queue at your earliest convenience.

Thanks,
Himanshu
---
 drivers/scsi/qla2xxx/qla_os.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn Jan. 24, 2018, 8:18 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Martin K. Petersen Jan. 31, 2018, 2:15 a.m. UTC | #2
Himanshu,

> This patch fixes memory corrpution while performing
> HBA Reset test.

Applied to 4.16/scsi-fixes. Thank you!
diff mbox

Patch

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 12ee6e02d146..afcb5567998a 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3625,6 +3625,8 @@  qla2x00_remove_one(struct pci_dev *pdev)
 	}
 	qla2x00_wait_for_hba_ready(base_vha);
 
+	qla2x00_wait_for_sess_deletion(base_vha);
+
 	/*
 	 * if UNLOAD flag is already set, then continue unload,
 	 * where it was set first.