Skip to content
Snippets Groups Projects
Commit 949bbd7c authored by Pavel Machek's avatar Pavel Machek Committed by Tom Rini
Browse files

catch wrong load address passed to fatload / ext2load


If filename is passed instead of address to ext2load or fatload,
u-boot silently accepts that, and uses 0 for load address and default
filename from environment. That is confusing, display help instead.

Signed-off-by: default avatarPavel Machek <pavel@denx.de>
parent 6b367467
No related branches found
No related tags found
No related merge requests found
......@@ -276,6 +276,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
unsigned long pos;
int len_read;
unsigned long time;
char *ep;
if (argc < 2)
return CMD_RET_USAGE;
......@@ -286,7 +287,9 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
return 1;
if (argc >= 4) {
addr = simple_strtoul(argv[3], NULL, 16);
addr = simple_strtoul(argv[3], &ep, 16);
if (ep == argv[3] || *ep != '\0')
return CMD_RET_USAGE;
} else {
addr_str = getenv("loadaddr");
if (addr_str != NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment