From: Tom Rini Date: Tue, 4 Mar 2014 20:52:35 +0000 (-0500) Subject: cmd_nvedit: Make 'env import -c' require size parameter X-Git-Tag: v2014.04-rc2~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3775dcd9c4ad9d7f19f2ff14989f5180aaba3d64;p=oweals%2Fu-boot.git cmd_nvedit: Make 'env import -c' require size parameter When importing a checksummed area we need to be told how big the area in question is so that we know that will match the size of the area which the checksum is generated against. Reported-by: Pierre AUBERT Signed-off-by: Tom Rini --- diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 5bcc324675..c53601cf74 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -1008,6 +1008,9 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, if (argc == 2) { size = simple_strtoul(argv[1], NULL, 16); + } else if (argc == 1 && chk) { + puts("## Error: external checksum format must pass size\n"); + return CMD_RET_FAILURE; } else { char *s = addr;