Commit 70f1396b authored by Dinghao Liu's avatar Dinghao Liu Committed by Greg Kroah-Hartman

scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort

[ Upstream commit ea403fde ]

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.cnAcked-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c642341b
...@@ -794,7 +794,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha, ...@@ -794,7 +794,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
if (res) if (res)
return res; goto ex_err;
ccb = &pm8001_ha->ccb_info[ccb_tag]; ccb = &pm8001_ha->ccb_info[ccb_tag];
ccb->device = pm8001_dev; ccb->device = pm8001_dev;
ccb->ccb_tag = ccb_tag; ccb->ccb_tag = ccb_tag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment