Skip to content

Commit

Permalink
Only request the BOS descriptor when bcdUSB > 0x0200
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed Mar 5, 2024
1 parent 8bef41c commit a4fdee0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gusb/gusb-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,14 @@ g_usb_device_get_bos_descriptors(GUsbDevice *self, GError **error)
g_usb_device_not_open_error(self, error);
return NULL;
}
if (g_usb_device_get_spec(self) <= 0x0200) {
g_set_error(error,
G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"not available as bcdUSB 0x%04x <= 0x0200",
g_usb_device_get_spec(self));
return NULL;
}

rc = libusb_get_bos_descriptor(priv->handle, &bos);
if (!g_usb_device_libusb_error_to_gerror(self, rc, error))
Expand Down

0 comments on commit a4fdee0

Please sign in to comment.