diff options
author | Rafael Mendonca <rafaelmendsr@gmail.com> | 2022-09-16 06:59:07 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-10-18 05:42:08 +0300 |
commit | dc8e483f684a24cc06e1d5fa958b54db58855093 (patch) | |
tree | e86851eddf08f5e68f0a262354e5065e2fcdb10b /drivers/scsi/atp870u.h | |
parent | 2331ce6126be8864b39490e705286b66e2344aac (diff) | |
download | linux-dc8e483f684a24cc06e1d5fa958b54db58855093.tar.xz |
scsi: lpfc: Fix memory leak in lpfc_create_port()
Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox
command") introduced allocations for the VMID resources in
lpfc_create_port() after the call to scsi_host_alloc(). Upon failure on the
VMID allocations, the new code would branch to the 'out' label, which
returns NULL without unwinding anything, thus skipping the call to
scsi_host_put().
Fix the problem by creating a separate label 'out_free_vmid' to unwind the
VMID resources and make the 'out_put_shost' label call only
scsi_host_put(), as was done before the introduction of allocations for
VMID.
Fixes: 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command")
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Link: https://lore.kernel.org/r/20220916035908.712799-1-rafaelmendsr@gmail.com
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/atp870u.h')
0 files changed, 0 insertions, 0 deletions