[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27dd749e-712f-46eb-9630-660a8f8f490d@gmail.com>
Date: Tue, 4 Feb 2025 10:33:58 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Jiasheng Jiang <jiashengjiangcool@...il.com>, broonie@...nel.org,
gregkh@...uxfoundation.org, rafael@...nel.org, dakr@...nel.org
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] regmap-irq: Add missing kfree()
Thanks Jiang!
On 02/02/2025 22:05, Jiasheng Jiang wrote:
> Add kfree() for "d->main_status_buf" in the error-handling path to prevent
> a memory leak.
>
> Fixes: a2d21848d921 ("regmap: regmap-irq: Add main status register support")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
This looks valid to me.
I still wonder if you could fix also the missing freeing from the
regmap_del_irq_chip()? (AFAICS, the freeing is missing from that as well).
> ---
> drivers/base/regmap/regmap-irq.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
> index 0bcd81389a29..b73ab3cda781 100644
> --- a/drivers/base/regmap/regmap-irq.c
> +++ b/drivers/base/regmap/regmap-irq.c
> @@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
> kfree(d->wake_buf);
> kfree(d->mask_buf_def);
> kfree(d->mask_buf);
> + kfree(d->main_status_buf);
> kfree(d->status_buf);
> kfree(d->status_reg_buf);
> if (d->config_buf) {
Powered by blists - more mailing lists