[PATCH 5/6] mmc: mmci: stm32: fail the probe if the private structure can't be allocated

Christophe Kerello christophe.kerello at foss.st.com
Tue Dec 1 08:18:44 PST 2026


When the private structure can't be allocated, sdmmc_variant_init()
continues without the delay block, so tuning silently stops being
available.

Now that the variant init can return an error, fail the probe with
-ENOMEM instead. A missing or unmappable delay block region is still
silently ignored, as the delay block is optional.

Signed-off-by: Christophe Kerello <christophe.kerello at foss.st.com>
---
 drivers/mmc/host/mmci_stm32_sdmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c
index 9c4098ce9b73..322bfe0a0945 100644
--- a/drivers/mmc/host/mmci_stm32_sdmmc.c
+++ b/drivers/mmc/host/mmci_stm32_sdmmc.c
@@ -761,7 +761,7 @@ int sdmmc_variant_init(struct mmci_host *host)
 
 	priv = devm_kzalloc(mmc_dev(host->mmc), sizeof(*priv), GFP_KERNEL);
 	if (!priv)
-		return 0;
+		return -ENOMEM;
 
 	dlyb = &priv->dlyb;
 	dlyb->base = base;

-- 
2.43.0




More information about the linux-arm-kernel mailing list