All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>
Cc: u-boot@lists.denx.de, Jaehoon Chung <jh80.chung@samsung.com>,
	Tom Rini <trini@konsulko.com>, Jens Wiklander <jenswi@kernel.org>,
	Bhimeswararao Matsa <bhimeswararao.matsa@gmail.com>,
	Yanir Levin <yanir.levin@tandemg.com>,
	Eran Moshe <emoshe@gsitechnology.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Christoph Stoidner <c.stoidner@phytec.de>,
	Tanmay Kathpalia <tanmay.kathpalia@gmail.com>,
	Jimmy Durand Wesolowski <jimmy.wesolowski@mobileye.com>,
	Iulian Banaga <iulianeugen.banaga@mobileye.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 3/5] mmc: sdhci: fix align_buffer memory leak on re-initialization
Date: Mon, 13 Jul 2026 16:42:52 +0800	[thread overview]
Message-ID: <alSlDBuE1fMQwZ1g@shlinux89> (raw)
In-Reply-To: <b86a6dff-b055-490c-88c0-bb320b97fddb@altera.com>

Hi Tanmay,

On Mon, Jul 13, 2026 at 12:20:10AM +0530, Kathpalia, Tanmay wrote:
>
>On 7/12/2026 6:37 PM, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>> 
>> sdhci_init() allocates a 512KB aligned bounce buffer for controllers
>> with SDHCI_QUIRK_32BIT_DMA_ADDR. In the non-DM code path, sdhci_init()
>> is registered as ops->init and called on every mmc_init(). Each call
>> allocates a new buffer without checking or freeing the previous one,
>> leaking 512KB per re-initialization.
>> 
>> Fix by guarding the allocation with !host->align_buffer so it only
>> allocates on the first call.
>> 
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>
>Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>

This should be R-b or A-b. I will use R-b if no objections.

Thanks
Peng

>
>> 

  reply	other threads:[~2026-07-13  8:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 13:07 [PATCH 0/5] mmc: misc fixes across MMC/SDHCI/RPMB Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 1/5] mmc: fix mmc_poll_for_busy() false timeout when card is ready Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 2/5] mmc: rpmb: fix tautological condition in RPMB_REQ_READ_DATA validation Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 3/5] mmc: sdhci: fix align_buffer memory leak on re-initialization Peng Fan (OSS)
2026-07-12 18:50   ` Kathpalia, Tanmay
2026-07-13  8:42     ` Peng Fan [this message]
2026-07-13  9:23       ` Kathpalia, Tanmay
2026-07-12 13:07 ` [PATCH 4/5] mmc: fix mmc_bwrite() ignoring host get_b_max() callback Peng Fan (OSS)
2026-07-12 13:07 ` [PATCH 5/5] mmc: fix mmc_deinit regression when card is at 1.8V signaling Peng Fan (OSS)
2026-07-12 18:20   ` Kathpalia, Tanmay

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=alSlDBuE1fMQwZ1g@shlinux89 \
    --to=peng.fan@oss.nxp.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=bhimeswararao.matsa@gmail.com \
    --cc=c.stoidner@phytec.de \
    --cc=emoshe@gsitechnology.com \
    --cc=iulianeugen.banaga@mobileye.com \
    --cc=jenswi@kernel.org \
    --cc=jh80.chung@samsung.com \
    --cc=jimmy.wesolowski@mobileye.com \
    --cc=kauschluss@disroot.org \
    --cc=peng.fan@nxp.com \
    --cc=tanmay.kathpalia@altera.com \
    --cc=tanmay.kathpalia@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=yanir.levin@tandemg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.