]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card()
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 30 Apr 2020 09:16:37 +0000 (11:16 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 28 May 2020 09:21:02 +0000 (11:21 +0200)
commit4f68edb78c9e7c080ad62913f3cd250ba7657b17
tree0bf986c607b93fa0e9950f90b117cb2d67ba7039
parent853b0fdb9f12e0a62fbb28d2ad798f651788dcf6
mmc: sdio: Fix potential NULL pointer error in mmc_sdio_init_card()

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: 84387840929d ("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
drivers/mmc/core/sdio.c