diff mbox series

[-next] mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe()

Message ID 20210323112956.1016884-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] mmc: sdhci-of-dwcmshc: fix error return code in dwcmshc_probe() | expand

Commit Message

Wei Yongjun March 23, 2021, 11:29 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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>
---
 drivers/mmc/host/sdhci-of-dwcmshc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ulf Hansson March 24, 2021, 10:20 a.m. UTC | #1
On Tue, 23 Mar 2021 at 12:20, 'w00385741 <weiyongjun1@huawei.com> wrote:
>
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  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;
>
>
diff mbox series

Patch

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;