|
|
73b847 |
From b82bcc0fc55035d04ac10143a909cc3a20bfcedf Mon Sep 17 00:00:00 2001
|
|
|
73b847 |
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
|
|
|
73b847 |
Date: Thu, 28 Nov 2019 20:40:32 +0100
|
|
|
73b847 |
Subject: [PATCH 055/181] vfs301: Use a transfer autopointer to cleanup it on
|
|
|
73b847 |
sync submission
|
|
|
73b847 |
|
|
|
73b847 |
Partially revert commit a855c0cc7, since the driver uses a sync transfer
|
|
|
73b847 |
and in such case the caller still keeps the ownership.
|
|
|
73b847 |
---
|
|
|
73b847 |
libfprint/drivers/vfs301_proto.c | 7 ++++---
|
|
|
73b847 |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
73b847 |
|
|
|
73b847 |
diff --git a/libfprint/drivers/vfs301_proto.c b/libfprint/drivers/vfs301_proto.c
|
|
|
73b847 |
index 84e2318..2bf8bbd 100644
|
|
|
73b847 |
--- a/libfprint/drivers/vfs301_proto.c
|
|
|
73b847 |
+++ b/libfprint/drivers/vfs301_proto.c
|
|
|
73b847 |
@@ -67,7 +67,8 @@ static void
|
|
|
73b847 |
usb_recv (FpDeviceVfs301 *dev, guint8 endpoint, int max_bytes, FpiUsbTransfer **out, GError **error)
|
|
|
73b847 |
{
|
|
|
73b847 |
GError *err = NULL;
|
|
|
73b847 |
- FpiUsbTransfer *transfer;
|
|
|
73b847 |
+
|
|
|
73b847 |
+ g_autoptr(FpiUsbTransfer) transfer = NULL;
|
|
|
73b847 |
|
|
|
73b847 |
/* XXX: This function swallows any transfer errors, that is obviously
|
|
|
73b847 |
* quite bad (it used to assert on no-error)! */
|
|
|
73b847 |
@@ -78,7 +79,6 @@ usb_recv (FpDeviceVfs301 *dev, guint8 endpoint, int max_bytes, FpiUsbTransfer **
|
|
|
73b847 |
|
|
|
73b847 |
fpi_usb_transfer_submit_sync (transfer, VFS301_DEFAULT_WAIT_TIMEOUT, &err;;
|
|
|
73b847 |
|
|
|
73b847 |
-
|
|
|
73b847 |
#ifdef DEBUG
|
|
|
73b847 |
usb_print_packet (0, err, transfer->buffer, transfer->actual_length);
|
|
|
73b847 |
#endif
|
|
|
73b847 |
@@ -97,7 +97,8 @@ static void
|
|
|
73b847 |
usb_send (FpDeviceVfs301 *dev, const guint8 *data, gssize length, GError **error)
|
|
|
73b847 |
{
|
|
|
73b847 |
GError *err = NULL;
|
|
|
73b847 |
- FpiUsbTransfer *transfer = NULL;
|
|
|
73b847 |
+
|
|
|
73b847 |
+ g_autoptr(FpiUsbTransfer) transfer = NULL;
|
|
|
73b847 |
|
|
|
73b847 |
/* XXX: This function swallows any transfer errors, that is obviously
|
|
|
73b847 |
* quite bad (it used to assert on no-error)! */
|
|
|
73b847 |
--
|
|
|
73b847 |
2.24.1
|
|
|
73b847 |
|