diff mbox series

mmc: check the return value of mmc_select_mode_and_width()

Message ID 20200123053112.31165-1-yamada.masahiro@socionext.com
State Accepted
Commit 8adf50effeda52bb84b2c2aa66bcebf2920778e9
Delegated to: Peng Fan
Headers show
Series mmc: check the return value of mmc_select_mode_and_width() | expand

Commit Message

Masahiro Yamada Jan. 23, 2020, 5:31 a.m. UTC
Since commit 01298da31d92 ("mmc: Change mode when switching to a boot
partition"), errors in mmc_select_mode_and_width() are ignored.
The return value should be checked.

Fixes: 01298da31d92 ("mmc: Change mode when switching to a boot partition")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mmc/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jaehoon Chung Jan. 23, 2020, 6:08 a.m. UTC | #1
On 1/23/20 2:31 PM, Masahiro Yamada wrote:
> Since commit 01298da31d92 ("mmc: Change mode when switching to a boot
> partition"), errors in mmc_select_mode_and_width() are ignored.
> The return value should be checked.
> 
> Fixes: 01298da31d92 ("mmc: Change mode when switching to a boot partition")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/mmc/mmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index d43983d4a648..b26e266c1c29 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -2575,7 +2575,7 @@ static int mmc_startup(struct mmc *mmc)
>  		err = mmc_get_capabilities(mmc);
>  		if (err)
>  			return err;
> -		mmc_select_mode_and_width(mmc, mmc->card_caps);
> +		err = mmc_select_mode_and_width(mmc, mmc->card_caps);
>  	}
>  #endif
>  	if (err)
>
diff mbox series

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d43983d4a648..b26e266c1c29 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2575,7 +2575,7 @@  static int mmc_startup(struct mmc *mmc)
 		err = mmc_get_capabilities(mmc);
 		if (err)
 			return err;
-		mmc_select_mode_and_width(mmc, mmc->card_caps);
+		err = mmc_select_mode_and_width(mmc, mmc->card_caps);
 	}
 #endif
 	if (err)