Skip to content

Commit

Permalink
cli_wp: Fix bail-out when multiple chips are detected
Browse files Browse the repository at this point in the history
We need to bail out in this case, too. Otherwise flashprog tries to
use the null pointer `flash'.

Change-Id: Id2588c7e8065169236cf56d67a524779c51f2577
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/310
  • Loading branch information
i-c-o-n committed Nov 21, 2024
1 parent e05e334 commit eb2c041
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cli_wp.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ int flashprog_wp_main(int argc, char *argv[])
if (ret == 3) {
fprintf(stderr, "Multiple flash chip definitions match the detected chip.\n"
"Please specify which chip definition to use with the -c <chipname> option.\n");
goto shutdown_ret;
} else if (ret) {
fprintf(stderr, "No EEPROM/flash device found.\n");
goto shutdown_ret;
Expand Down

0 comments on commit eb2c041

Please sign in to comment.