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:
8a856db
)
mmc: fix off-by-one bug in mmc_startup_v4()
author
Alexander Kochetkov
<al.kochet@gmail.com>
Tue, 20 Feb 2018 11:35:55 +0000
(14:35 +0300)
committer
Jaehoon Chung
<jh80.chung@samsung.com>
Fri, 23 Feb 2018 06:57:41 +0000
(15:57 +0900)
MMC card with EXT_CSD_REV value 9 will trigger off-by-one
bug while accessing mmc_versions array. The patch fix that.
Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
drivers/mmc/mmc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/mmc.c
b/drivers/mmc/mmc.c
index 31f65f6e242f6eb57d2ffddbd3146e42e014d6e0..c93089330030f07a42bd38502c4a536ffec75447 100644
(file)
--- a/
drivers/mmc/mmc.c
+++ b/
drivers/mmc/mmc.c
@@
-1969,7
+1969,7
@@
static int mmc_startup_v4(struct mmc *mmc)
return -ENOMEM;
memcpy(mmc->ext_csd, ext_csd, MMC_MAX_BLOCK_LEN);
- if (ext_csd[EXT_CSD_REV] > ARRAY_SIZE(mmc_versions))
+ if (ext_csd[EXT_CSD_REV] >
=
ARRAY_SIZE(mmc_versions))
return -EINVAL;
mmc->version = mmc_versions[ext_csd[EXT_CSD_REV]];