mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-03 11:28:58 +00:00
unifying: Ensure HID devices are closed if the subclassed open() or probe() failed
Fixes the critical warnings in https://github.com/hughsie/fwupd/issues/117
This commit is contained in:
parent
26a52be318
commit
fd45583728
@ -746,7 +746,7 @@ lu_device_open (LuDevice *device, GError **error)
|
||||
/* subclassed */
|
||||
if (klass->open != NULL) {
|
||||
if (!klass->open (device, error)) {
|
||||
g_usb_device_close (priv->usb_device, NULL);
|
||||
lu_device_close (device, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@ -754,7 +754,7 @@ lu_device_open (LuDevice *device, GError **error)
|
||||
|
||||
/* subclassed */
|
||||
if (!lu_device_probe (device, error)) {
|
||||
g_usb_device_close (priv->usb_device, NULL);
|
||||
lu_device_close (device, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user