[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AM6PR04MB586338893C089939732092468F7C0@AM6PR04MB5863.eurprd04.prod.outlook.com>
Date: Tue, 19 Feb 2019 20:56:56 +0000
From: Leo Li <leoyang.li@....com>
To: Colin King <colin.king@...onical.com>,
Roy Pledge <roy.pledge@....com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH][next] soc: fsl: dpio: fix memory leak of a struct qbman
on error exit path
> -----Original Message-----
> From: Colin King <colin.king@...onical.com>
> Sent: Tuesday, February 19, 2019 8:05 AM
> To: Roy Pledge <roy.pledge@....com>; Leo Li <leoyang.li@....com>;
> linuxppc-dev@...ts.ozlabs.org; linux-arm-kernel@...ts.infradead.org
> Cc: kernel-janitors@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [PATCH][next] soc: fsl: dpio: fix memory leak of a struct qbman on
> error exit path
>
> From: Colin Ian King <colin.king@...onical.com>
>
> Currently the error check for a null reg leaks a struct qbman that was
> allocated earlier. Fix this by kfree'ing p on the error exit path.
>
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Applied for next. Thanks.
> ---
> drivers/soc/fsl/dpio/qbman-portal.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/soc/fsl/dpio/qbman-portal.c
> b/drivers/soc/fsl/dpio/qbman-portal.c
> index 0bddb85c0ae5..5a73397ae79e 100644
> --- a/drivers/soc/fsl/dpio/qbman-portal.c
> +++ b/drivers/soc/fsl/dpio/qbman-portal.c
> @@ -180,6 +180,7 @@ struct qbman_swp *qbman_swp_init(const struct
> qbman_swp_desc *d)
> reg = qbman_read_register(p, QBMAN_CINH_SWP_CFG);
> if (!reg) {
> pr_err("qbman: the portal is not enabled!\n");
> + kfree(p);
> return NULL;
> }
>
> --
> 2.20.1
Powered by blists - more mailing lists