Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Linas Vepstas and committed by
James Bottomley
5daa49ef be521466

+2 -3
+2 -3
drivers/scsi/lpfc/lpfc_init.c
··· 1817 1817 struct lpfc_sli *psli = &phba->sli; 1818 1818 struct lpfc_sli_ring *pring; 1819 1819 1820 - if (state == pci_channel_io_perm_failure) { 1821 - lpfc_pci_remove_one(pdev); 1820 + if (state == pci_channel_io_perm_failure) 1822 1821 return PCI_ERS_RESULT_DISCONNECT; 1823 - } 1822 + 1824 1823 pci_disable_device(pdev); 1825 1824 /* 1826 1825 * There may be I/Os dropped by the firmware.