]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: lpfc: Add REG_VFI mailbox cmd error handling
authorJustin Tee <justin.tee@broadcom.com>
Tue, 31 Mar 2026 20:59:22 +0000 (13:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 3 Apr 2026 01:34:01 +0000 (21:34 -0400)
commit5b402a8aceb15682457b7e65eef1a133d6dfe7e3
treeabf84e55903e2d343990e6abb43597b8ed54d5dc
parentf75754f2feaa3be2f07838ef53914d15a10fd587
scsi: lpfc: Add REG_VFI mailbox cmd error handling

If lpfc_issue_reg_vfi() returns an error in lpfc_rcv_plogi(), then
execution of lpfc_rcv_plogi() continues and lpfc_reg_rpi() is called, which
allocates an mbuf.  When this REG_RPI mailbox is issued, it inevitably
fails because the VFI is not registered.  However, the REG_RPI failure does
not free the mbuf that was allocated in lpfc_reg_rpi() because there is no
check for mbox error status in lpfc_defer_plogi_acc().

Fix by adding a check in lpfc_rcv_plogi() if lpfc_reg_vfi() fails, then
exit early.  Also, add mailbox status check in lpfc_defer_plogi_acc to
enter the REG_RPI mbox_cmpl functions and free the allocated mbuf.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://patch.msgid.link/20260331205928.119833-5-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nportdisc.c