Skip to content

Commit e5bce3c

Browse files
tititiou36storulf
authored andcommitted
mmc: sdhci-cadence: Fix an error handling path in sdhci_cdns_probe()
If devm_reset_control_get_optional_exclusive() fails, some resources still need to be released. So branch to the error handling path instead of returning directly. Fixes: aad53d4 ("mmc: sdhci-cadence: Support mmc hardware reset") Signed-off-by: Christophe JAILLET <[email protected]> Acked-by: Adrian Hunter <[email protected]> Acked-by: Brad Larson <[email protected]> Link: https://lore.kernel.org/r/f61599a9ef23767c2d66e5af9c975f05ef1cec6b.1682430069.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson <[email protected]>
1 parent 003fb0a commit e5bce3c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/mmc/host/sdhci-cadence.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
540540

541541
if (host->mmc->caps & MMC_CAP_HW_RESET) {
542542
priv->rst_hw = devm_reset_control_get_optional_exclusive(dev, NULL);
543-
if (IS_ERR(priv->rst_hw))
544-
return dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
545-
"reset controller error\n");
543+
if (IS_ERR(priv->rst_hw)) {
544+
ret = dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
545+
"reset controller error\n");
546+
goto free;
547+
}
546548
if (priv->rst_hw)
547549
host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset;
548550
}

0 commit comments

Comments
 (0)