]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hantek-dso/protocol.c
Check usb_get_port_path() return value
[libsigrok.git] / src / hardware / hantek-dso / protocol.c
index 39d87c4433bb316564e0cdff84df818b76c2f808..c74187ada435f2441e7aa3b88ed926194c9d530b 100644 (file)
@@ -130,7 +130,9 @@ SR_PRIV int dso_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;