From: Binbin Zhou <zhoubb.aaron@gmail.com>
To: Andrew Jeffery <andrew@codeconstruct.com.au>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
Huacai Chen <chenhuacai@loongson.cn>,
Ulf Hansson <ulf.hansson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Huacai Chen <chenhuacai@kernel.org>,
linux-mmc@vger.kernel.org, Joel Stanley <joel@jms.id.au>,
linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org
Subject: Re: [PATCH 18/34] mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free()
Date: Wed, 28 May 2025 12:42:21 +0800 [thread overview]
Message-ID: <CAMpQs4LchvbX5-1Gr_epq42DSdfj0uegdqaG2Vh=X2DULSbaWA@mail.gmail.com> (raw)
In-Reply-To: <753cd65ebf659972c8a33e5f8e579b9fa8738682.camel@codeconstruct.com.au>
Hi Andrew:
Thanks for your reply.
On Wed, May 28, 2025 at 8:44 AM Andrew Jeffery
<andrew@codeconstruct.com.au> wrote:
>
> On Mon, 2025-05-26 at 14:06 +0800, Binbin Zhou wrote:
> > Since the devm_mmc_alloc_host() helper is already in
> > use,
>
> This doesn't appear to be true? aspeed_sdhci_probe() calls
> sdhci_pltfm_init(), and following that through eventually we call
> mmc_alloc_host() (the non-devm_ variant).
>
> That said, there are some error paths in aspeed_sdhci_probe() where we
> leak the object. Improving the code would be helpful, but my
> understanding is this patch isn't right.
Sorry, I have a different thought.
In the original code, there does seem to be a leakage of objects, for example:
pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pltfm_host->clk))
return PTR_ERR(pltfm_host->clk);
With this error path, we should goto err_pltfm_free;
Now, I have replaced mmc_alloc_host() with devm_mmc_alloc_host() in
Patch-1[1], so I don't think there will be any error path leakage of
objects.
[1]: https://lore.kernel.org/all/6fd5afb003982bb5edbf95f76b605686223730e0.1747792905.git.zhoubinbin@loongson.cn/
>
> Andrew
--
Thanks.
Binbin
next prev parent reply other threads:[~2025-05-29 0:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1747792905.git.zhoubinbin@loongson.cn>
2025-05-26 6:06 ` [PATCH 18/34] mmc: sdhci-of-aspeed: Drop the use of sdhci_pltfm_free() Binbin Zhou
2025-05-28 0:43 ` Andrew Jeffery
2025-05-28 4:42 ` Binbin Zhou [this message]
2025-05-29 0:46 ` Andrew Jeffery
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='CAMpQs4LchvbX5-1Gr_epq42DSdfj0uegdqaG2Vh=X2DULSbaWA@mail.gmail.com' \
--to=zhoubb.aaron@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=andrew@codeconstruct.com.au \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=joel@jms.id.au \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-mmc@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=ulf.hansson@linaro.org \
--cc=zhoubinbin@loongson.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;
as well as URLs for NNTP newsgroup(s).