[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200922152919.GA18907@duo.ucw.cz>
Date: Tue, 22 Sep 2020 17:29:19 +0200
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Jack Wang <jinpu.wang@...ud.ionos.com>,
Dinghao Liu <dinghao.liu@....edu.cn>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 10/49] scsi: pm8001: Fix memleak in
pm8001_exec_internal_task_abort
Hi!
> From: Dinghao Liu <dinghao.liu@....edu.cn>
>
> [ Upstream commit ea403fde7552bd61bad6ea45e3feb99db77cb31e ]
>
> When pm8001_tag_alloc() fails, task should be freed just like it is done in
> the subsequent error paths.
Does the timer also need to be deleted, as in the next error return?
Or better, can we move tag_alloc before add_timer()?
Best regards,
Pavel
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
> index 5be4212312cb0..ba79b37d8cf7e 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -794,7 +794,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;
> --
> 2.25.1
>
>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists