summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-08-23 17:14:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-23 08:46:14 +0200
commitfcb46945dea6477ac61815f3b7aba36493c26ae8 (patch)
treee1751de0c523581c81ceeeddf1d5976c6d6e72c2
parent170a3e265456713eb0938f90a160c1fd76362048 (diff)
downloadlinux-stable-fcb46945dea6477ac61815f3b7aba36493c26ae8.tar.gz
linux-stable-fcb46945dea6477ac61815f3b7aba36493c26ae8.tar.bz2
linux-stable-fcb46945dea6477ac61815f3b7aba36493c26ae8.zip
scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort
[ Upstream commit ea403fde7552bd61bad6ea45e3feb99db77cb31e ] When pm8001_tag_alloc() fails, task should be freed just like it is done in the subsequent error paths. Link: https://lore.kernel.org/r/20200823091453.4782-1-dinghao.liu@zju.edu.cn Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index e64a13f0bce1..61a2da30f94b 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -795,7 +795,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
if (res)
- return res;
+ goto ex_err;
ccb = &pm8001_ha->ccb_info[ccb_tag];
ccb->device = pm8001_dev;
ccb->ccb_tag = ccb_tag;