synaptics: Fix error handling when releasing the USB interface

The error may not be NULL, as such we need a second variable and then
we'll only forward any error from g_usb_device_release_interface if
there was none before.
This commit is contained in:
Benjamin Berg 2021-08-10 19:04:50 +02:00
parent ec42b2ade1
commit c928d7bd8f
1 changed files with 5 additions and 1 deletions

View File

@ -1348,8 +1348,12 @@ fps_deinit_cb (FpiDeviceSynaptics *self,
bmkt_response_t *resp,
GError *error)
{
g_autoptr(GError) err = NULL;
/* Release usb interface */
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &error);
g_usb_device_release_interface (fpi_device_get_usb_device (FP_DEVICE (self)), 0, 0, &err);
if (!error)
error = g_steal_pointer (&err);
g_clear_object (&self->interrupt_cancellable);