summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2016-04-22 13:34:16 -0600
committerMarek Vasut <marex@denx.de>2016-04-25 17:56:30 +0200
commit3517de6d26de7baeddb2c9e9bf145456c35885e1 (patch)
tree076bfd1b2e0462840cbc2ab449987cdc95f627a4 /drivers
parente1b0f6fe3d0a0317486fb879e83dc1440cac3029 (diff)
dfu: ram: fix number base of RAM entity parameters
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> Tested-by: Mugunthan V N <mugunthanvnm@ti.com> [Test HW: AM335x BBB]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dfu/dfu_ram.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c
index 1391a0d52b..c1b00217c9 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;