From: Antonio Ospite Date: Sat, 23 Mar 2013 22:03:48 +0000 (+0100) Subject: am7xxx_mode_switch: release interface only if claimed X-Git-Tag: v0.1.4~38 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/a29024a9e977da3836c44d778703fd951e47e19b?ds=inline am7xxx_mode_switch: release interface only if claimed --- diff --git a/examples/am7xxx_mode_switch.c b/examples/am7xxx_mode_switch.c index 7509981..572586c 100644 --- a/examples/am7xxx_mode_switch.c +++ b/examples/am7xxx_mode_switch.c @@ -81,16 +81,16 @@ int main(void) if (ret != 0 || (unsigned int)transferred != len) { fprintf(stderr, "ret: %d\ttransferred: %d (expected %u)\n", ret, transferred, len); - goto out_libusb_close; + goto out_libusb_release_interface; } fprintf(stderr, "OK, command sent!\n"); -out_libusb_close: +out_libusb_release_interface: libusb_release_interface(usb_device, AM7XXX_STORAGE_INTERFACE); +out_libusb_close: libusb_close(usb_device); usb_device = NULL; - out: libusb_exit(NULL); return ret;