make usb backend status check work, remove some dead code
authorGeorge Talusan <george.talusan@gmail.com>
Mon, 22 Feb 2016 16:41:48 +0000 (11:41 -0500)
committerGeorge Talusan <george.talusan@gmail.com>
Mon, 22 Feb 2016 16:41:48 +0000 (11:41 -0500)
src/stlink-usb.c

index d54aea875145b4af24fe88940ee9e1f3a840a11a..c4c693d2b4514de39d7992aae46b32ed83e80641 100644 (file)
@@ -259,6 +259,7 @@ void _stlink_usb_status(stlink_t * sl) {
         printf("[!] send_recv\n");
         return;
     }
+    sl->q_len = (size_t) size;
 }
 
 void _stlink_usb_force_debug(stlink_t *sl) {
@@ -644,7 +645,6 @@ stlink_t* stlink_open_usb(const int verbose, int reset, char *p_usb_iserial) {
     stlink_t* sl = NULL;
     struct stlink_libusb* slu = NULL;
     int error = -1;
-    libusb_device** devs = NULL;
     int config;
 
     sl = malloc(sizeof (stlink_t));
@@ -785,10 +785,6 @@ stlink_t* stlink_open_usb(const int verbose, int reset, char *p_usb_iserial) {
     error = stlink_load_device_params(sl);
 
 on_libusb_error:
-    if (devs != NULL) {
-        libusb_free_device_list(devs, 1);
-    }
-
     if (error == -1) {
         stlink_close(sl);
         return NULL;