Commit cfeb3b96 authored by Justin Tee's avatar Justin Tee Committed by Li Lingfeng
Browse files

scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc()

stable inclusion
from stable-v5.10.215
commit c473288f27d15014447de5a891bdf22a0695847a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9QGLA
CVE: CVE-2024-35930

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c473288f27d15014447de5a891bdf22a0695847a



--------------------------------

[ Upstream commit 2ae917d4bcab80ab304b774d492e2fcd6c52c06b ]

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: default avatarJustin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240131185112.149731-3-justintee8345@gmail.com


Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
parent 5af85baa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment