scsi: lpfc: Fix resource leak in lpfc_sli4_send_seq_to_ulp()
authorJames Smart <jsmart2021@gmail.com>
Tue, 26 Apr 2022 18:14:19 +0000 (11:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:34 +0000 (10:22 +0200)
commit40cf4ea4d2d497f7732c87d350ba5c3f5e8a43a1
tree3d123ed5a7029a6cd2d373699b78c2f39a6773da
parent3ab08d7c16531311f80a70e0637e60429af9710f
scsi: lpfc: Fix resource leak in lpfc_sli4_send_seq_to_ulp()

[ Upstream commit 646db1a560f44236b7278b822ca99a1d3b6ea72c ]

If no handler is found in lpfc_complete_unsol_iocb() to match the rctl of a
received frame, the frame is dropped and resources are leaked.

Fix by returning resources when discarding an unhandled frame type.  Update
lpfc_fc_frame_check() handling of NOP basic link service.

Link: https://lore.kernel.org/r/20220426181419.9154-1-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_sli.c