Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Felix Gu <ustc.gu@gmail.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Xiangsheng Hou <xiangsheng.hou@mediatek.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] spi: mtk-snfi: fix memory leak in probe
Date: Thu, 16 Apr 2026 13:51:14 +0100	[thread overview]
Message-ID: <8e90522a-dc3e-4c1c-8e99-a5ded42f41c3@sirena.org.uk> (raw)
In-Reply-To: <20260416-mtk-snfi-v1-1-fafccfd288f9@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On Thu, Apr 16, 2026 at 07:46:20PM +0800, Felix Gu wrote:

> ms->buf is allocated in mtk_snand_setup_pagefmt() but was not freed on
> the following error paths.

>  	ret = nand_ecc_register_on_host_hw_engine(&ms->ecc_eng);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to register ecc engine.\n");
> -		goto release_ecc;
> +		goto free_buf;
>  	}
>  
>  	ret = devm_add_action_or_reset(&pdev->dev, mtk_unregister_ecc_engine,
>  				       &ms->ecc_eng);
>  	if (ret) {
>  		dev_err_probe(&pdev->dev, ret, "failed to add ECC unregister action\n");
> -		goto release_ecc;
> +		goto free_buf;
>  	}
>  
>  	ctlr->num_chipselect = 1;

What about spi_register_controller() failures?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-04-16 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 11:46 [PATCH] spi: mtk-snfi: fix memory leak in probe Felix Gu
2026-04-16 12:51 ` Mark Brown [this message]

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=8e90522a-dc3e-4c1c-8e99-a5ded42f41c3@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=ustc.gu@gmail.com \
    --cc=xiangsheng.hou@mediatek.com \
    /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