summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-10-16 19:00:39 +0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-10 14:40:43 +0300
commit2fd322a58ed17b9159aa369e7c9ea01eb6a5d5ae (patch)
treee54b4234ae66880fe3f16ae46e6838466564e255
parentc197787ced5b42bde224d9ee70473d87a824119a (diff)
downloadlinux-2fd322a58ed17b9159aa369e7c9ea01eb6a5d5ae.tar.xz
mmc: core: Don't panic when fetching EXT_CSD
Instead of doing BUG_ON(), return an error code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/core/mmc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index fe801e612b1f..efaa9f8f07b0 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -185,8 +185,8 @@ static int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd)
int err;
u8 *ext_csd;
- BUG_ON(!card);
- BUG_ON(!new_ext_csd);
+ if (!card || !new_ext_csd)
+ return -EINVAL;
if (!mmc_can_ext_csd(card))
return -EOPNOTSUPP;
@@ -368,8 +368,6 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
int err = 0, idx;
unsigned int part_size;
- BUG_ON(!card);
-
/* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */
card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE];
if (card->csd.structure == 3) {