diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2007-03-08 17:19:11 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-03-11 11:42:17 -0400 |
commit | 5daa49ef05c44ce94bed0bab0f9ba4a9e952863b (patch) | |
tree | 7af047846343ffee0d047a60c9ad81e2d5de8e76 | |
parent | be521466feb3bb1cd89de82a2b1d080e9ebd3cb6 (diff) |
[SCSI] lpfc: avoid double-free during PCI error failure
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>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 9d014e5a81c4..057fd7e0e379 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev, | |||
1817 | struct lpfc_sli *psli = &phba->sli; | 1817 | struct lpfc_sli *psli = &phba->sli; |
1818 | struct lpfc_sli_ring *pring; | 1818 | struct lpfc_sli_ring *pring; |
1819 | 1819 | ||
1820 | if (state == pci_channel_io_perm_failure) { | 1820 | if (state == pci_channel_io_perm_failure) |
1821 | lpfc_pci_remove_one(pdev); | ||
1822 | return PCI_ERS_RESULT_DISCONNECT; | 1821 | return PCI_ERS_RESULT_DISCONNECT; |
1823 | } | 1822 | |
1824 | pci_disable_device(pdev); | 1823 | pci_disable_device(pdev); |
1825 | /* | 1824 | /* |
1826 | * There may be I/Os dropped by the firmware. | 1825 | * There may be I/Os dropped by the firmware. |