Skip to content

Commit

Permalink
Merge pull request #890 from rewolff/error_return_in_failed_probe
Browse files Browse the repository at this point in the history
Error return in failed probe (Fixes #887)
  • Loading branch information
Nightwalker-87 authored Mar 21, 2020
2 parents 691647b + d439956 commit 33ac8da
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,15 +1069,17 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[ST
}

ret = stlink_load_device_params(sl);

on_libusb_error:
if (ret == -1) {
stlink_close(sl);
return NULL;
// This one didn't have any message.
goto on_libusb_error;
}

return sl;

on_libusb_error:
stlink_close(sl);
return NULL;


on_error:
if (slu->libusb_ctx)
libusb_exit(slu->libusb_ctx);
Expand Down

0 comments on commit 33ac8da

Please sign in to comment.