mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 00:25:26 +00:00
trivial: Do not allow calling klass->close multiple times on the same device
This commit is contained in:
parent
4fbba6f7c0
commit
18fcbdac53
@ -239,6 +239,10 @@ fu_usb_device_close (FuUsbDevice *device, GError **error)
|
||||
g_return_val_if_fail (FU_IS_USB_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
/* already open */
|
||||
if (priv->usb_device_locker == NULL)
|
||||
return TRUE;
|
||||
|
||||
/* subclassed */
|
||||
if (klass->close != NULL) {
|
||||
if (!klass->close (device, error))
|
||||
|
Loading…
Reference in New Issue
Block a user