mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe()
Subsystems (3)
PATCH 1/1 mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe()
From: Wei Yongjun <[email protected]>
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 <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/mmc/host/sdhci-of-dwcmshc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-dwcmshc.c +3 -1
@@ -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;
Quoted 9 lines · On Tue, 23 Mar 2021 at 12:20, 'w00385741 <[email protected]> wrote:
From: Wei Yongjun <[email protected]>
Fix to return negative error code
-ENOMEMfrom 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 <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 21 lines
--- drivers/mmc/host/sdhci-of-dwcmshc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/mmc/host/sdhci-of-dwcmshc.c +3
-1@@ -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;