diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/Kconfig | 2 | ||||
-rw-r--r-- | commands/barebox-update.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/commands/Kconfig b/commands/Kconfig index 72fadb6c70..17bbe0f27a 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -1722,7 +1722,7 @@ config CMD_GPIO gpio_direction_output - set direction of a GPIO pin to output - Usage: gpio_direction_output GPIO + Usage: gpio_direction_output GPIO VALUE gpio_get_value - return value of a GPIO pin diff --git a/commands/barebox-update.c b/commands/barebox-update.c index c2f2b68e08..84798ab0d9 100644 --- a/commands/barebox-update.c +++ b/commands/barebox-update.c @@ -28,6 +28,7 @@ static int do_barebox_update(int argc, char *argv[]) { int opt, ret, repair = 0; struct bbu_data data = {}; + void *image = NULL; while ((opt = getopt(argc, argv, "t:yf:ld:r")) > 0) { switch (opt) { @@ -59,9 +60,10 @@ static int do_barebox_update(int argc, char *argv[]) if (argc - optind > 0) { data.imagefile = argv[optind]; - data.image = read_file(data.imagefile, &data.len); - if (!data.image) + image = read_file(data.imagefile, &data.len); + if (!image) return -errno; + data.image = image; } else { if (!repair) return COMMAND_ERROR_USAGE; @@ -69,7 +71,7 @@ static int do_barebox_update(int argc, char *argv[]) ret = barebox_update(&data); - free(data.image); + free(image); return ret; } |