Skip to content
Commit 14c1dd95 authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen
Browse files

scsi: lpfc: Fix memory leak on lcb_context

Currently there is an error return path that neglects to free the
allocation for lcb_context.  Fix this by adding a new error free exit path
that kfree's lcb_context before returning.  Use this new kfree exit path in
another exit error path that also kfree's the same object, allowing a line
of code to be removed.

Link: https://lore.kernel.org/r/20201118141314.462471-1-colin.king@canonical.com


Fixes: 4430f7fd ("scsi: lpfc: Rework locations of ndlp reference taking")
Reviewed-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Resource leak")
parent 61795a53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment