]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Fix lpfc_io_buf resource leak in lpfc_get_scsi_buf_s4 error path
authorJames Smart <jsmart2021@gmail.com>
Tue, 28 Jan 2020 00:23:02 +0000 (16:23 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 11 Feb 2020 03:46:55 +0000 (22:46 -0500)
commit5c8fa5c57244329ce3fbbebd893bb36275428cdb
tree3027d85c45ef45cc8d1ddcbfdd4d36e45cff0dc0
parent1b6f0e0dd2241ec46209c5518a60ae13da724bc6
scsi: lpfc: Fix lpfc_io_buf resource leak in lpfc_get_scsi_buf_s4 error path

If a call to lpfc_get_cmd_rsp_buf_per_hdwq returns NULL (memory allocation
failure), a previously allocated lpfc_io_buf resource is leaked.

Fix by releasing the lpfc_io_buf resource in the failure path.

Fixes: 2e6f0e65c5e2 ("scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.")
Cc: <stable@vger.kernel.org> # v5.4+
Link: https://lore.kernel.org/r/20200128002312.16346-3-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>
drivers/scsi/lpfc/lpfc_scsi.c