]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hantek-6xxx/protocol.c
Check usb_get_port_path() return value
[libsigrok.git] / src / hardware / hantek-6xxx / protocol.c
index 8e406ffe03f04db5220cfccc18653ac10b72d024..75d8ab91c0f14fb4c2cfed4ce2222173e53f4660 100644 (file)
@@ -46,7 +46,9 @@ SR_PRIV int hantek_6xxx_open(struct sr_dev_inst *sdi)
                        /*
                         * Check device by its physical USB bus/port address.
                         */
-                       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;
+
                        if (strcmp(sdi->connection_id, connection_id))
                                /* This is not the one. */
                                continue;