summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2020-04-30 11:16:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-22 09:05:09 +0200
commit5fff08f45970e1f78472b27080e77695289a75e3 (patch)
tree4f25b18bcfeba1eab4951e7c78ede4ca3ea078fe /drivers/mmc
parentfe06085e4e68ec177a8f475a149194602cb5a672 (diff)
downloadlinux-stable-5fff08f45970e1f78472b27080e77695289a75e3.tar.gz
linux-stable-5fff08f45970e1f78472b27080e77695289a75e3.tar.bz2
linux-stable-5fff08f45970e1f78472b27080e77695289a75e3.zip
mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card()
commit f04086c225da11ad16d7f9a2fbca6483ab16dded upstream. During some scenarios mmc_sdio_init_card() runs a retry path for the UHS-I specific initialization, which leads to removal of the previously allocated card. A new card is then re-allocated while retrying. However, in one of the corresponding error paths we may end up to remove an already removed card, which likely leads to a NULL pointer exception. So, let's fix this. Fixes: 5fc3d80ef496 ("mmc: sdio: don't use rocr to check if the card could support UHS mode") Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20200430091640.455-2-ulf.hansson@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 0aa99694b937..4e72ad24322f 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -720,9 +720,8 @@ try_again:
/* Retry init sequence, but without R4_18V_PRESENT. */
retries = 0;
goto try_again;
- } else {
- goto remove;
}
+ return err;
}
/*