* [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters
@ 2016-04-22 19:34 Stephen Warren
2016-04-25 6:40 ` Mugunthan V N
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Warren @ 2016-04-22 19:34 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
U-Boot typically interprets unprefixed numbers as base 16, and DFU RAM
entity parsing has historically done so. Reverse the change to default
to base 10, so that values in previously working command-lines aren't
mis-parsed, causing RAM corruption, crashes, hangs, etc.
Fixes: 6aeb877afef0 ("drivers: dfu: ram: fix a crash with dfu ram with invalid dfu_alt_info env")
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
drivers/dfu/dfu_ram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c
index 1391a0d52b6d..c1b00217c911 100644
--- a/drivers/dfu/dfu_ram.c
+++ b/drivers/dfu/dfu_ram.c
@@ -72,8 +72,8 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s)
}
dfu->layout = DFU_RAM_ADDR;
- dfu->data.ram.start = (void *)simple_strtoul(argv[1], NULL, 0);
- dfu->data.ram.size = simple_strtoul(argv[2], NULL, 0);
+ dfu->data.ram.start = (void *)simple_strtoul(argv[1], NULL, 16);
+ dfu->data.ram.size = simple_strtoul(argv[2], NULL, 16);
dfu->write_medium = dfu_write_medium_ram;
dfu->get_medium_size = dfu_get_medium_size_ram;
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters
2016-04-22 19:34 [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters Stephen Warren
@ 2016-04-25 6:40 ` Mugunthan V N
2016-04-25 7:28 ` Lukasz Majewski
0 siblings, 1 reply; 4+ messages in thread
From: Mugunthan V N @ 2016-04-25 6:40 UTC (permalink / raw)
To: u-boot
On Saturday 23 April 2016 01:04 AM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> U-Boot typically interprets unprefixed numbers as base 16, and DFU RAM
> entity parsing has historically done so. Reverse the change to default
> to base 10, so that values in previously working command-lines aren't
> mis-parsed, causing RAM corruption, crashes, hangs, etc.
>
> Fixes: 6aeb877afef0 ("drivers: dfu: ram: fix a crash with dfu ram with invalid dfu_alt_info env")
>
> Cc: Mugunthan V N <mugunthanvnm@ti.com>
> Cc: Tom Rini <trini@konsulko.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters
2016-04-25 6:40 ` Mugunthan V N
@ 2016-04-25 7:28 ` Lukasz Majewski
2016-04-25 8:47 ` Mugunthan V N
0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Majewski @ 2016-04-25 7:28 UTC (permalink / raw)
To: u-boot
Hi Mugunthan,
> On Saturday 23 April 2016 01:04 AM, Stephen Warren wrote:
> > From: Stephen Warren <swarren@nvidia.com>
> >
> > U-Boot typically interprets unprefixed numbers as base 16, and DFU
> > RAM entity parsing has historically done so. Reverse the change to
> > default to base 10, so that values in previously working
> > command-lines aren't mis-parsed, causing RAM corruption, crashes,
> > hangs, etc.
> >
> > Fixes: 6aeb877afef0 ("drivers: dfu: ram: fix a crash with dfu ram
> > with invalid dfu_alt_info env")
> >
> > Cc: Mugunthan V N <mugunthanvnm@ti.com>
> > Cc: Tom Rini <trini@konsulko.com>
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> > ---
>
> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
I assume that you have also tested this patch on your setup?
Would it be possible to also receive Tested-by: from you?
>
> Regards
> Mugunthan V N
>
>
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters
2016-04-25 7:28 ` Lukasz Majewski
@ 2016-04-25 8:47 ` Mugunthan V N
0 siblings, 0 replies; 4+ messages in thread
From: Mugunthan V N @ 2016-04-25 8:47 UTC (permalink / raw)
To: u-boot
On Monday 25 April 2016 12:58 PM, Lukasz Majewski wrote:
> Hi Mugunthan,
>
>> On Saturday 23 April 2016 01:04 AM, Stephen Warren wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> U-Boot typically interprets unprefixed numbers as base 16, and DFU
>>> RAM entity parsing has historically done so. Reverse the change to
>>> default to base 10, so that values in previously working
>>> command-lines aren't mis-parsed, causing RAM corruption, crashes,
>>> hangs, etc.
>>>
>>> Fixes: 6aeb877afef0 ("drivers: dfu: ram: fix a crash with dfu ram
>>> with invalid dfu_alt_info env")
>>>
>>> Cc: Mugunthan V N <mugunthanvnm@ti.com>
>>> Cc: Tom Rini <trini@konsulko.com>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>> ---
>>
>> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
>
> I assume that you have also tested this patch on your setup?
>
> Would it be possible to also receive Tested-by: from you?
>
Tested the patch successfully on AM335x BBB.
Tested-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-25 8:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22 19:34 [U-Boot] [PATCH] dfu: ram: fix number base of RAM entity parameters Stephen Warren
2016-04-25 6:40 ` Mugunthan V N
2016-04-25 7:28 ` Lukasz Majewski
2016-04-25 8:47 ` Mugunthan V N
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox