]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Avoid NULL pointer dereference in lpfc_els_abort()
authorGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Wed, 24 May 2017 21:48:51 +0000 (18:48 -0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 1 Jun 2017 02:44:13 +0000 (22:44 -0400)
commitf489d7a5e74500dfe8607c61e7dfc4c892aaf7a0
treeb6f5523f6e08ca4f9286f0196c1bb4bef5a74c74
parentaa7a728143f3cb09e3e9a82f33cc1fbb2708228f
scsi: lpfc: Avoid NULL pointer dereference in lpfc_els_abort()

We might have a NULL pring in lpfc_els_abort(), for example on error
recovery path, since queues are destroyed during error recovery
mechanism.

In this case, we should just drop the abort since the queues will be
recreated anyway. This patch just verifies for NULL pointer and stop the
abortion of the queue in case of a NULL pring.

Also, this patch converts return type of lpfc_els_abort() from int to
void, since it's not checked anywhere.

Reported-by: Harsha Thyagaraja <hathyaga@in.ibm.com>
Reported-by: Naresh Bannoth <nbannoth@in.ibm.com>
Tested-by: Raphael Silva <raphasil@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/lpfc/lpfc_nportdisc.c