]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix NULL pointer dereference during PCI error recovery
authorGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Wed, 17 May 2017 22:02:17 +0000 (19:02 -0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 18 May 2017 00:19:23 +0000 (20:19 -0400)
commit1e2126b7ed5c690366905f8cdf3e4e84876c5219
treea6b1291e400870fe15464716572ce3968ed4bbdb
parent4e781229c662bd6c28d09c02e2bd87c08ccd21c7
scsi: lpfc: Fix NULL pointer dereference during PCI error recovery

Recent commit on patchset "lpfc updates for 11.2.0.14" fixed an issue
about dereferencing a NULL pointer on port reset. The specific commit,
named "lpfc: Fix system crash when port is reset.", is missing a check
against NULL pointer on lpfc_els_flush_cmd() though.

Since we destroy the queues on adapter resets, like in PCI error
recovery path, we need the validation present on this patch in order to
avoid a NULL pointer dereference when trying to flush commands of ELS
wq, after it has been destroyed (which would lead to a kernel oops).

Tested-by: Raphael Silva <raphasil@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c