mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 00:45:53 +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 (FU_IS_USB_DEVICE (device), FALSE);
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
/* already open */
|
||||||
|
if (priv->usb_device_locker == NULL)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
/* subclassed */
|
/* subclassed */
|
||||||
if (klass->close != NULL) {
|
if (klass->close != NULL) {
|
||||||
if (!klass->close (device, error))
|
if (!klass->close (device, error))
|
||||||
|
Loading…
Reference in New Issue
Block a user