mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Jianhao Xu <jianhao.xu@seu.edu.cn>, Zilin Guan <zilin@seu.edu.cn>,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Angelo Gioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH v2] soc: mediatek: svs: Fix memory leak in svs_enable_debug_write()
Date: Mon, 29 Dec 2025 09:19:19 +0100	[thread overview]
Message-ID: <1d9b46ba-728e-459a-9d82-0f49e2fe08b9@web.de> (raw)
In-Reply-To: <20251228162636.3829733-1-zilin@seu.edu.cn>

…
> +++ 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?


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

  reply	other threads:[~2025-12-29  8:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-28 16:26 Zilin Guan
2025-12-29  8:19 ` Markus Elfring [this message]
2025-12-29 13:17   ` Zilin Guan
2026-01-08  9:16 ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d9b46ba-728e-459a-9d82-0f49e2fe08b9@web.de \
    --to=markus.elfring@web.de \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=zilin@seu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®