diff options
Diffstat (limited to 'usb-linux.c')
-rw-r--r-- | usb-linux.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usb-linux.c b/usb-linux.c index 216ac20f8e..9cd543d714 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -278,7 +278,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) if (strlen(line) > 0) line[strlen(line) - 1] = '\0'; if (line[0] == 'T' && line[1] == ':') { - if (device_count) { + if (device_count && (vendor_id || product_id)) { + /* New device. Add the previously discovered device. */ ret = func(opaque, bus_num, addr, class_id, vendor_id, product_id, product_name, speed); if (ret) @@ -321,7 +322,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func) } fail: ; } - if (device_count) { + if (device_count && (vendor_id || product_id)) { + /* Add the last device. */ ret = func(opaque, bus_num, addr, class_id, vendor_id, product_id, product_name, speed); } |