]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: sdhci-of-bst: Fix memory leak in sdhci_bst_alloc_bounce_buffer()
authorFelix Gu <ustc.gu@gmail.com>
Mon, 2 Mar 2026 13:47:12 +0000 (21:47 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 9 Mar 2026 13:03:24 +0000 (14:03 +0100)
commit670f524faedccb1749beeb445c833ecae8c7409b
tree715dfbfa98a64a7fad4aa554e7938a19ad9b4426
parent824254f3c2518fb24e5d7aad1d9651f87f24ff2c
mmc: sdhci-of-bst: Fix memory leak in sdhci_bst_alloc_bounce_buffer()

In sdhci_bst_alloc_bounce_buffer(), if dma_alloc_coherent() fails, the
function immediately returns -ENOMEM without releasing the reserved
memory, which results in a memory leak.

Add the missing of_reserved_mem_device_release() call before returning
-ENOMEM to properly clean up the reserved memory.

Fixes: 695824f45629 ("mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-bst.c