]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mmc: sdhci: unmap the bounce buffer before device release
authorMyeonghun Pak <mhun512@gmail.com>
Mon, 27 Jul 2026 14:03:22 +0000 (23:03 +0900)
committerUlf Hansson <ulfh@kernel.org>
Tue, 4 Aug 2026 11:24:20 +0000 (13:24 +0200)
commit9e9f561269dff35e6f84ed21776ec37fd6360b03
tree4140fd21b9740c41927d21671a09e001829497e3
parentae31bcc92bb42502bb7c9029e6dc7a824cf6cd14
mmc: sdhci: unmap the bounce buffer before device release

sdhci_allocate_bounce_buffer() allocates its buffer with devm_kmalloc()
but maps it with dma_map_single(). The buffer is therefore released by
devres without the streaming DMA mapping being unmapped.

Register a managed action after dma_map_single() succeeds so the mapping
is removed before devres releases the buffer. The action is registered
only for buffers allocated and mapped by the SDHCI core, leaving buffers
provided by host drivers under their existing ownership.

Fixes: bd9b902798ab ("mmc: sdhci: Implement an SDHCI-specific bounce buffer")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
drivers/mmc/host/sdhci.c