Skip to content
/ linux Public

Commit 34884c4

Browse files
Wei Yongjunstorulf
authored andcommitted
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>
1 parent eb81ed5 commit 34884c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mmc/host/sdhci-of-dwcmshc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,10 @@ static int dwcmshc_probe(struct platform_device *pdev)
404404

405405
if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) {
406406
rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL);
407-
if (!rk_priv)
407+
if (!rk_priv) {
408+
err = -ENOMEM;
408409
goto err_clk;
410+
}
409411

410412
priv->priv = rk_priv;
411413

0 commit comments

Comments
 (0)