[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251229131712.388207-1-zilin@seu.edu.cn>
Date: Mon, 29 Dec 2025 13:17:12 +0000
From: Zilin Guan <zilin@....edu.cn>
To: markus.elfring@....de
Cc: angelogioacchino.delregno@...labora.com,
jianhao.xu@....edu.cn,
kernel-janitors@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
matthias.bgg@...il.com,
zilin@....edu.cn
Subject: Re: [PATCH v2] soc: mediatek: svs: Fix memory leak in svs_enable_debug_write()
On Mon, Dec 29, 2025 at 09:19:19AM +0100, Markus Elfring wrote:
> …
> > +++ b/drivers/soc/mediatek/mtk-svs.c
> > @@ -789,7 +789,7 @@ static ssize_t svs_enable_debug_write(struct file *filp,
> > struct svs_bank *svsb = file_inode(filp)->i_private;
> > struct svs_platform *svsp = dev_get_drvdata(svsb->dev);
> > int enabled, ret;
> > - char *buf = NULL;
> > + char *buf __free(kfree) = NULL;
> >
> > if (count >= PAGE_SIZE)
> > return -EINVAL;
> …
>
> You may reduce the scopes for involved local variables,
> don't you?
Thanks for your suggestion. I will reduce the scope of the local variables
in v3.
> See also:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc3#n262
>
> Regards,
> Markus
Thanks, I will add your suggested Cc tag in v3.
Regards,
Zilin Guan
Powered by blists - more mailing lists