if (b != usb->bus || a != usb->address)
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;
+
((struct sr_dev_inst *)sdi)->connection_id = g_strdup(connection_id);
break;
}