From e4ce146fefe7cfd475b9d8fdec1101b188b746db Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 21 Nov 2015 20:27:25 +0100 Subject: [PATCH] sr_usb_find(): Increase the 'bus' limit to 255. On some systems it can happen that the USB 'bus' number is a lot larger than 64, but sr_usb_find() currently errors out if it is > 64. Example: Bus 250 Device 006: ID 1ab1:04ce 1ab1 DS1000Z Series[...] Increase that limit so that the code will work everywhere. This bus number is queried via libusb_get_bus_number() which returns an uint8_t, so we're limiting to 255 here. Thanks to 'ssi' on IRC for reporting the issue. --- src/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb.c b/src/usb.c index ba56e864..02510cae 100644 --- a/src/usb.c +++ b/src/usb.c @@ -359,7 +359,7 @@ SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn) return NULL; } - if (bus > 64) { + if (bus > 255) { sr_err("Invalid bus specified: %d.", bus); return NULL; }