scsi: qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()
stable inclusion from stable-v5.10.76 commit 96f0aebf29be25254fa585af43924e34aa21fd9a category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RB0N CVE: CVE-2021-47473 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=96f0aebf29be25254fa585af43924e34aa21fd9a --------------------------- [ Upstream commit 7fb223d0 ] Commit 8c0eb596 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()"), intended to change: bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN to: bsg_job->request->msgcode != FC_BSG_RPT_ELS but changed it to: bsg_job->request->msgcode == FC_BSG_RPT_ELS instead. Change the == to a != to avoid leaking the fcport structure or freeing unallocated memory. Link: https://lore.kernel.org/r/20211012191834.90306-2-jgu@purestorage.com Fixes: 8c0eb596 ("[SCSI] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()") Reviewed-by:Bart Van Assche <bvanassche@acm.org> Signed-off-by:
Joy Gu <jgu@purestorage.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Conflicts: drivers/scsi/qla2xxx/qla_bsg.c [Some prev patch is not merged, but is not relevant to the bugfix] Signed-off-by:
Hui Tang <tanghui20@huawei.com>
Loading
Please sign in to comment