libusb_get_device_list() may return a negative number

Change-Id: Ibf5f88d51c36ff9577f748c004562bd8ed2e96bf
Fixes: CID#240717
changes/29/25929/1
Vadim Yanitskiy 11 months ago
parent ae3d54ceeb
commit cdc0ed783c
  1. 4
      host/lib/usrp_prims_libusb1.cc

@ -183,8 +183,8 @@ usrp_find_device (int nth, bool fx2_ok_p, libusb_context *ctx)
// skipped if you know what you're doing.
assert (ctx != NULL);
size_t cnt = libusb_get_device_list(ctx, &list);
size_t i = 0;
ssize_t cnt = libusb_get_device_list(ctx, &list);
ssize_t i = 0;
if (cnt < 0)
fprintf(stderr, "usrp: libusb_get_device_list failed: %s\n",

Loading…
Cancel
Save