mmc: fix off-by-one bug in mmc_startup_v4()
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
SD-card with EXT_CSD_REV value 9 will trigger off-by-one bug while accessing mmc_versions array. The patch fix that.
--- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/mmc.c +1 -1
@@ -1974,7 +1974,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 ]];
Signature · 1 line
1.7.9.5
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Quoted 2 lines · Alexander Kochetkov
SD-card with
EXT_CSD_REVvalue 9 will trigger off-by-one bug while accessingmmc_versionsarray. The patch fix that.
I'm confusing about commit-msg. "SD-card with EXT_CSD_REV"?
Best Regards,
Jaehoon Chung
Quoted 20 lines
Signed-off-by Alexander Kochetkov <[email protected]>--- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/mmc.c +1
-1@@ -1974,7 +1974,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 ]];
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Quoted 7 lines
21 февр. 2018 г., в 9:37, Jaehoon Chung <[email protected]> написал(а):
I'm confusing about commit-msg. "SD-card with
EXT_CSD_REV"?Best Regards,
Jaehoon Chung
I glad to write better, but don’t know. Would this one better?
In future, SD-cards with revision 9 (with REV value 9 inside EXT_CSD register) will trigger off-by-one bug while accessing mmc_versions array.
Regards,
Alexander.
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Hi,
Quoted 11 lines · Alexander Kochetkov
Quoted 7 lines
21 февр. 2018 г., в 9:37, Jaehoon Chung <[email protected]> написал(а):
I'm confusing about commit-msg. "SD-card with
EXT_CSD_REV"?Best Regards,
Jaehoon ChungI glad to write better, but don’t know. Would this one better?
In future, SD-cards with revision 9 (with REV value 9 inside
EXT_CSDregister)
Do you mean SD-card or MMC-card? :)
SD doesn't have EXT_CSD register.
- Removed Pantelis's mail account. Instead, add my account, plz.
Best Regards,
Jaehoon Chung
Quoted 6 lines
will trigger off-by-one bug while accessing
mmc_versionsarray.Regards,
Alexander.
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Quoted 3 lines
Do you mean SD-card or MMC-card? :)
SD doesn't haveEXT_CSDregister.
I see now. MMC-card. So, send v2? or you can simple fix SD with MMC in commit msg.
Quoted 2 lines
- Removed Pantelis's mail account. Instead, add my account, plz.
I took it from here:
https://www.denx.de/wiki/U-Boot/Custodians
Regards,
Alexander.
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Hi Alexander,
Quoted 5 lines · Alexander Kochetkov
Quoted 3 lines
Do you mean SD-card or MMC-card? :)
SD doesn't haveEXT_CSDregister.I see now. MMC-card. So, send v2? or you can simple fix SD with MMC in commit msg.
If you're ok, i will apply yours after changing commit-msg.
Best Regards,
Jaehoon Chung
Quoted 13 lines
Quoted 3 lines
- Removed Pantelis's mail account. Instead, add my account, plz.
I took it from here:
https://www.denx.de/wiki/U-Boot/CustodiansRegards,
Alexander.
PATCH 1/1 mmc: fix off-by-one bug in mmc_startup_v4()
Quoted 10 lines · Jaehoon Chung
Hi Alexander,
Quoted 5 lines · Alexander Kochetkov
Quoted 3 lines
Do you mean SD-card or MMC-card? :)
SD doesn't haveEXT_CSDregister.I see now. MMC-card. So, send v2? or you can simple fix SD with MMC in commit msg.
If you're ok, i will apply yours after changing commit-msg.
Applied to u-boot-mmc.
Best Regards,
Jaehoon Chung
Quoted 23 lines
Best Regards,
Jaehoon ChungQuoted 13 lines
Quoted 3 lines
- Removed Pantelis's mail account. Instead, add my account, plz.
I took it from here:
https://www.denx.de/wiki/U-Boot/CustodiansRegards,
Alexander._______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot