James Smart 858f090696 scsi: lpfc: Fix rpi release when deleting vport
commit 97acd0019d5dadd9c0e111c2083c889bfe548f25 upstream.

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: 	9b1640686470 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:20:01 +01:00
..
2019-10-23 06:26:33 -04:00
2020-01-09 10:19:59 +01:00
2019-12-31 16:45:16 +01:00
2019-09-18 11:14:31 -07:00
2019-09-22 12:02:21 -07:00
2019-08-27 09:43:59 +02:00
2019-09-23 17:20:40 -04:00
2020-01-09 10:19:43 +01:00
2019-09-22 10:55:08 -07:00
2019-09-18 11:14:31 -07:00
2020-01-09 10:19:47 +01:00
2019-12-17 19:56:42 +01:00
2019-09-18 11:05:34 -07:00