aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorWei Yongjun2021-03-23 11:29:56 +0000
committerUlf Hansson2021-03-30 11:42:07 +0200
commit34884c4f6483b9d9f14973cd0c9c06404fe6e13d (patch)
treec8355a0c0b9af1bb0afb39c707b1a827449d31b4 /drivers/mmc/host
parenteb81ed518079eaf8aca1053ffba54c56271b9f35 (diff)
mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe()
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: c2c4da37837e ("mmc: sdhci-of-dwcmshc: add rockchip platform support") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20210323112956.1016884-1-weiyongjun1@huawei.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-of-dwcmshc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
index 1113a56fe174..34d26e3884a0 100644
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -404,8 +404,10 @@ static int dwcmshc_probe(struct platform_device *pdev)
if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) {
rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL);
- if (!rk_priv)
+ if (!rk_priv) {
+ err = -ENOMEM;
goto err_clk;
+ }
priv->priv = rk_priv;