diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-01 16:13:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-01 16:13:20 +0100 |
commit | ed23f7556dd3da4a728ec6d409cf6c265fe2a124 (patch) | |
tree | d727876a00e4c4e9090cc8ceb8859e9a728bb7b9 | |
parent | 79b796f945ea7d5c2b0e2a74f9b8819cb7948680 (diff) | |
parent | a26e7bd6323288be21676ac9d8e8beccb74a1209 (diff) | |
download | usbutils-ed23f7556dd3da4a728ec6d409cf6c265fe2a124.tar.gz |
usbreset: Allow idProduct and idVendor to be 0
-rw-r--r-- | usbreset.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -65,6 +65,8 @@ static struct usbentry *parse_devlist(DIR *d) } while (!isdigit(e->d_name[0]) || strchr(e->d_name, ':')); memset(&dev, 0, sizeof(dev)); + dev.vendor_id = -1; + dev.product_id = -1; attr = sysfs_attr(e->d_name, "busnum"); if (attr) @@ -90,7 +92,7 @@ static struct usbentry *parse_devlist(DIR *d) if (attr) strcpy(dev.product_name, attr); - if (dev.bus_num && dev.dev_num && dev.vendor_id && dev.product_id) + if (dev.bus_num && dev.dev_num && dev.vendor_id >= 0 && dev.product_id >= 0) return &dev; return NULL; |