mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-01-17 04:40:21 +01:00
Fix crash in up_device_csr_finalize()
Spotted when running regression tests in KVM. There, initializing a HID device causes a "could not initialize libusb: -99" warning, but the device is created nevertheless. Do not crash in _finalize() by trying to call libusb_exit(NULL).
This commit is contained in:
parent
d92aec6520
commit
46f1c7f028
1 changed files with 2 additions and 1 deletions
|
|
@ -323,7 +323,8 @@ up_device_csr_finalize (GObject *object)
|
|||
csr = UP_DEVICE_CSR (object);
|
||||
g_return_if_fail (csr->priv != NULL);
|
||||
|
||||
libusb_exit (csr->priv->ctx);
|
||||
if (csr->priv->ctx != NULL);
|
||||
libusb_exit (csr->priv->ctx);
|
||||
if (csr->priv->poll_timer_id > 0)
|
||||
g_source_remove (csr->priv->poll_timer_id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue