scsi: lpfc: Prevent failure to reregister with NVMe transport after PRLI retry
authorJustin Tee <justin.tee@broadcom.com>
Fri, 25 Apr 2025 19:48:02 +0000 (12:48 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Apr 2025 01:38:14 +0000 (21:38 -0400)
commitdf117c93f58ab93c71413496491fdf543dbd7eca
tree1502d94eac88ca3899f36e4a6ce358d70ad13b7d
parent19d768dca549d492fcf222f50067752e80062bc0
scsi: lpfc: Prevent failure to reregister with NVMe transport after PRLI retry

A failure to unregister with the NVMe transport may occur when a PRLI is
retried.

Remove duplicate testing of NLP_NVME_TARGET flag. Add a secondary check
of the registered state based on the nrport information.  Further qualify
the ndlp reference count modification when nvme_fc_register_remoteport()
returns an error.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20250425194806.3585-5-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_nvme.c