mirror of
https://git.proxmox.com/git/fwupd
synced 2025-06-05 12:00:24 +00:00
logitech-hidpp: Only shutdown the IO channel if it was created
This commit is contained in:
parent
6174425ee1
commit
35d37f8d2c
@ -180,9 +180,11 @@ static gboolean
|
|||||||
fu_logitech_hidpp_peripheral_close (FuDevice *device, GError **error)
|
fu_logitech_hidpp_peripheral_close (FuDevice *device, GError **error)
|
||||||
{
|
{
|
||||||
FuLogitechHidPpPeripheral *self = FU_UNIFYING_PERIPHERAL (device);
|
FuLogitechHidPpPeripheral *self = FU_UNIFYING_PERIPHERAL (device);
|
||||||
if (!fu_io_channel_shutdown (self->io_channel, error))
|
if (self->io_channel != NULL) {
|
||||||
return FALSE;
|
if (!fu_io_channel_shutdown (self->io_channel, error))
|
||||||
g_clear_object (&self->io_channel);
|
return FALSE;
|
||||||
|
g_clear_object (&self->io_channel);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,9 +49,11 @@ static gboolean
|
|||||||
fu_logitech_hidpp_runtime_close (FuDevice *device, GError **error)
|
fu_logitech_hidpp_runtime_close (FuDevice *device, GError **error)
|
||||||
{
|
{
|
||||||
FuLogitechHidPpRuntime *self = FU_UNIFYING_RUNTIME (device);
|
FuLogitechHidPpRuntime *self = FU_UNIFYING_RUNTIME (device);
|
||||||
if (!fu_io_channel_shutdown (self->io_channel, error))
|
if (self->io_channel != NULL) {
|
||||||
return FALSE;
|
if (!fu_io_channel_shutdown (self->io_channel, error))
|
||||||
g_clear_object (&self->io_channel);
|
return FALSE;
|
||||||
|
g_clear_object (&self->io_channel);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user