scsi: qla2xxx: Fix memory corruption during hba reset test
authorQuinn Tran <quinn.tran@cavium.com>
Tue, 23 Jan 2018 19:05:21 +0000 (11:05 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 31 Jan 2018 02:14:30 +0000 (21:14 -0500)
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>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_os.c

index 12ee6e02d146d169940ead69af93d42d79d6508b..afcb5567998a51d6b1aae1c4872d0b2d5312ec71 100644 (file)
@@ -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.