]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lecroy-logicstudio/api.c
Check usb_get_port_path() return value
[libsigrok.git] / src / hardware / lecroy-logicstudio / api.c
index 6dd0bd0179fa7f8354567f24eb537f240fec60e9..e75b5b09e97bc5a1d7090b9b6b9e484a87aba125 100644 (file)
@@ -134,7 +134,8 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                if (des.idVendor != LOGICSTUDIO16_VID)
                        continue;
 
-               usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+               if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+                       continue;
 
                usb = NULL;
 
@@ -210,7 +211,8 @@ static int open_device(struct sr_dev_inst *sdi)
                        des.idProduct != LOGICSTUDIO16_PID_HAVE_FIRMWARE)
                        continue;
 
-               usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+               if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+                       continue;
 
                /*
                 * Check if this device is the same one that we associated