* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
@ 2018-02-20 11:35 ` Alexander Kochetkov
2018-02-21 6:37 ` Jaehoon Chung
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kochetkov @ 2018-02-20 11:35 UTC (permalink / raw)
To: u-boot
SD-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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 99e2a75..3aa153a 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -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]];
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-20 11:35 ` [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4() Alexander Kochetkov
@ 2018-02-21 6:37 ` Jaehoon Chung
2018-02-21 8:03 ` Alexander Kochetkov
0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Chung @ 2018-02-21 6:37 UTC (permalink / raw)
To: u-boot
On 02/20/2018 08:35 PM, Alexander Kochetkov wrote:
> SD-card with EXT_CSD_REV value 9 will trigger off-by-one
> bug while accessing mmc_versions array. The patch fix that.
I'm confusing about commit-msg. "SD-card with EXT_CSD_REV"?
Best Regards,
Jaehoon Chung
>
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
> drivers/mmc/mmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 99e2a75..3aa153a 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -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]];
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-21 6:37 ` Jaehoon Chung
@ 2018-02-21 8:03 ` Alexander Kochetkov
2018-02-21 8:39 ` Jaehoon Chung
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kochetkov @ 2018-02-21 8:03 UTC (permalink / raw)
To: u-boot
> 21 февр. 2018 г., в 9:37, Jaehoon Chung <jh80.chung@samsung.com> написал(а):
>
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-21 8:03 ` Alexander Kochetkov
@ 2018-02-21 8:39 ` Jaehoon Chung
2018-02-21 8:44 ` Alexander Kochetkov
0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Chung @ 2018-02-21 8:39 UTC (permalink / raw)
To: u-boot
Hi,
On 02/21/2018 05:03 PM, Alexander Kochetkov wrote:
>
>> 21 февр. 2018 г., в 9:37, Jaehoon Chung <jh80.chung@samsung.com> написал(а):
>>
>> 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)
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
> will trigger off-by-one bug while accessing mmc_versions array.
>
> Regards,
> Alexander.
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-21 8:39 ` Jaehoon Chung
@ 2018-02-21 8:44 ` Alexander Kochetkov
2018-02-21 8:57 ` Jaehoon Chung
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kochetkov @ 2018-02-21 8:44 UTC (permalink / raw)
To: u-boot
> Do you mean SD-card or MMC-card? :)
> SD doesn't have EXT_CSD register.
I see now. MMC-card. So, send v2? or you can simple fix SD with MMC in commit msg.
>
> - 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-21 8:44 ` Alexander Kochetkov
@ 2018-02-21 8:57 ` Jaehoon Chung
2018-02-23 7:01 ` Jaehoon Chung
0 siblings, 1 reply; 7+ messages in thread
From: Jaehoon Chung @ 2018-02-21 8:57 UTC (permalink / raw)
To: u-boot
Hi Alexander,
On 02/21/2018 05:44 PM, Alexander Kochetkov wrote:
>
>> Do you mean SD-card or MMC-card? :)
>> SD doesn't have EXT_CSD register.
>
> 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
>
>>
>> - 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.
>
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4()
2018-02-21 8:57 ` Jaehoon Chung
@ 2018-02-23 7:01 ` Jaehoon Chung
0 siblings, 0 replies; 7+ messages in thread
From: Jaehoon Chung @ 2018-02-23 7:01 UTC (permalink / raw)
To: u-boot
On 02/21/2018 05:57 PM, Jaehoon Chung wrote:
> Hi Alexander,
>
> On 02/21/2018 05:44 PM, Alexander Kochetkov wrote:
>>
>>> Do you mean SD-card or MMC-card? :)
>>> SD doesn't have EXT_CSD register.
>>
>> 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
>
> Best Regards,
> Jaehoon Chung
>
>>
>>>
>>> - 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.
>>
>>
>>
>>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-23 7:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20180220113626epcas4p2e4fa5097ad6cac85fb42649fb6d7ad6d@epcas4p2.samsung.com>
2018-02-20 11:35 ` [U-Boot] [PATCH] mmc: fix off-by-one bug in mmc_startup_v4() Alexander Kochetkov
2018-02-21 6:37 ` Jaehoon Chung
2018-02-21 8:03 ` Alexander Kochetkov
2018-02-21 8:39 ` Jaehoon Chung
2018-02-21 8:44 ` Alexander Kochetkov
2018-02-21 8:57 ` Jaehoon Chung
2018-02-23 7:01 ` Jaehoon Chung
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.