Only request the BOS descriptor for newer libgusb versions

This fixes a deadlock only recently debugged and fixed in GUsb.
This commit is contained in:
Richard Hughes 2022-10-06 09:20:39 +01:00
parent 71af241835
commit ac27638878
2 changed files with 3 additions and 3 deletions

View File

@ -367,7 +367,7 @@ fu_usb_device_setup(FuDevice *device, GError **error)
return FALSE;
}
#if G_USB_CHECK_VERSION(0, 4, 0)
#if G_USB_CHECK_VERSION(0, 4, 2)
/* get the platform capability BOS descriptors */
bos_descriptors = g_usb_device_get_bos_descriptors(priv->usb_device, NULL);
for (guint i = 0; bos_descriptors != NULL && i < bos_descriptors->len; i++) {

View File

@ -3181,7 +3181,7 @@ fu_backend_usb_func(gconstpointer user_data)
g_autoptr(GPtrArray) possible_plugins = NULL;
g_autoptr(JsonParser) parser = json_parser_new();
#if !G_USB_CHECK_VERSION(0, 4, 0)
#if !G_USB_CHECK_VERSION(0, 4, 2)
g_test_skip("GUsb version too old");
return;
#endif
@ -3244,7 +3244,7 @@ fu_backend_usb_invalid_func(gconstpointer user_data)
g_autoptr(GPtrArray) devices = NULL;
g_autoptr(JsonParser) parser = json_parser_new();
#if !G_USB_CHECK_VERSION(0, 4, 0)
#if !G_USB_CHECK_VERSION(0, 4, 2)
g_test_skip("GUsb version too old");
return;
#endif