Skip to content

Commit f04086c

Browse files
committed
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: 5fc3d80 ("mmc: sdio: don't use rocr to check if the card could support UHS mode") Cc: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c2b613d commit f04086c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/mmc/core/sdio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
718718
/* Retry init sequence, but without R4_18V_PRESENT. */
719719
retries = 0;
720720
goto try_again;
721-
} else {
722-
goto remove;
723721
}
722+
return err;
724723
}
725724

726725
/*

0 commit comments

Comments
 (0)