mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
scsi: lpfc: Fix panic if driver unloaded when port is offline
[ Upstream commit d580c61374 ]
System crashes when the lpfc module is unloaded after making the port
offline
The nvme queue pointers were freed during port offline, but were later
accessed in pci remove path.
Validate the pointers in pci remove path before accessing them.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
074263d61e
commit
435962f3be
@@ -2976,7 +2976,7 @@ lpfc_nvme_wait_for_io_drain(struct lpfc_hba *phba)
|
||||
struct lpfc_sli_ring *pring;
|
||||
u32 i, wait_cnt = 0;
|
||||
|
||||
if (phba->sli_rev < LPFC_SLI_REV4)
|
||||
if (phba->sli_rev < LPFC_SLI_REV4 || !phba->sli4_hba.nvme_wq)
|
||||
return;
|
||||
|
||||
/* Cycle through all NVME rings and make sure all outstanding
|
||||
@@ -2985,6 +2985,9 @@ lpfc_nvme_wait_for_io_drain(struct lpfc_hba *phba)
|
||||
for (i = 0; i < phba->cfg_nvme_io_channel; i++) {
|
||||
pring = phba->sli4_hba.nvme_wq[i]->pring;
|
||||
|
||||
if (!pring)
|
||||
continue;
|
||||
|
||||
/* Retrieve everything on the txcmplq */
|
||||
while (!list_empty(&pring->txcmplq)) {
|
||||
msleep(LPFC_XRI_EXCH_BUSY_WAIT_T1);
|
||||
|
||||
Reference in New Issue
Block a user