scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc()
authorJustin Tee <justin.tee@broadcom.com>
Wed, 31 Jan 2024 18:50:57 +0000 (10:50 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 6 Feb 2024 01:51:34 +0000 (20:51 -0500)
commit2ae917d4bcab80ab304b774d492e2fcd6c52c06b
tree9ae99253f2372555b63606d4dfae242ba799274d
parent3d0f9342ae200aa1ddc4d6e7a573c6f8f068d994
scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc()

The call to lpfc_sli4_resume_rpi() in lpfc_rcv_padisc() may return an
unsuccessful status.  In such cases, the elsiocb is not issued, the
completion is not called, and thus the elsiocb resource is leaked.

Check return value after calling lpfc_sli4_resume_rpi() and conditionally
release the elsiocb resource.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240131185112.149731-3-justintee8345@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nportdisc.c