projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1da8eb5
)
mmc: fix for old MMCs (below version 4)
author
Jean-Jacques Hiblot
<jjhiblot@ti.com>
Thu, 30 Nov 2017 16:43:58 +0000
(17:43 +0100)
committer
Jaehoon Chung
<jh80.chung@samsung.com>
Fri, 12 Jan 2018 09:11:04 +0000
(18:11 +0900)
The ext_csd is allocated only for MMC above version 4. The compare will
crash or fail for older MMCs.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
drivers/mmc/mmc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/mmc.c
b/drivers/mmc/mmc.c
index 0ebcc45516621c542dabaa2ca632f8e593f3d156..2a58031c198421725a1be32f32bd024a4fefd24e 100644
(file)
--- a/
drivers/mmc/mmc.c
+++ b/
drivers/mmc/mmc.c
@@
-1657,6
+1657,9
@@
static int mmc_read_and_compare_ext_csd(struct mmc *mmc)
const u8 *ext_csd = mmc->ext_csd;
ALLOC_CACHE_ALIGN_BUFFER(u8, test_csd, MMC_MAX_BLOCK_LEN);
+ if (mmc->version < MMC_VERSION_4)
+ return 0;
+
err = mmc_send_ext_csd(mmc, test_csd);
if (err)
return err;