Skip to content

Commit

Permalink
[SCSI] lpfc: avoid double-free during PCI error failure
Browse files Browse the repository at this point in the history
If a PCI error is detected that cannot be recovered from, there
will be a double call of lpfc_pci_remove_one(), with the second call
resulting in a null-pointer dereference. The first call occurs in
lpfc_io_error_detected(), and the second call during pci device
remove. This patch eliminates the first call; its un-needed.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Linas Vepstas authored and James Bottomley committed Mar 11, 2007
1 parent be52146 commit 5daa49e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev,
struct lpfc_sli *psli = &phba->sli;
struct lpfc_sli_ring *pring;

if (state == pci_channel_io_perm_failure) {
lpfc_pci_remove_one(pdev);
if (state == pci_channel_io_perm_failure)
return PCI_ERS_RESULT_DISCONNECT;
}

pci_disable_device(pdev);
/*
* There may be I/Os dropped by the firmware.
Expand Down

0 comments on commit 5daa49e

Please sign in to comment.