]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix rpi release when deleting vport
authorJames Smart <jsmart2021@gmail.com>
Sun, 22 Sep 2019 03:58:51 +0000 (20:58 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 1 Oct 2019 02:07:09 +0000 (22:07 -0400)
commit67b1eafe62dc22de45ae6f85e6baa6483e75ed2f
tree9a4c505eee39ea2c4dc93eed22d48a665a7875bc
parent6e3dcf89916692da982b5e6fc4c5bab891b6b5b8
scsi: lpfc: Fix rpi release when deleting vport

A prior use-after-free mailbox fix solved it's problem by null'ing a ndlp
pointer.  However, further testing has shown that this change causes a
later state change to occasionally be skipped, which results in a reference
count never being decremented thus the rpi is never released, which causes
a vport delete to never succeed.

Revise the fix in the prior patch to no longer null the ndlp. Instead the
RELEASE_RPI flag is set which will drive the release of the rpi.

Given the new code was added at a deep indentation level, refactor the code
block using a new routine that avoids the indentation issues.

Fixes: 01aacaa06fc9 ("scsi: lpfc: Fix use-after-free mailbox cmd completion")
Link: https://lore.kernel.org/r/20190922035906.10977-6-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_sli.c