From: Wei Yongjun <weiyongjun1@xxxxxxxxxx> 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@xxxxxxxxxx> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx> --- drivers/mmc/host/sdhci-of-dwcmshc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c index 06873686d5e9..e96c628aeeeb 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -383,8 +383,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;