From 69fe7a1b8c62076d276e07a3db173f273143099f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 12 Dec 2018 16:56:33 +0100 Subject: [PATCH] elan: Fix "garbage value" errors in elan_cmd_cb() libfprint/drivers/elan.c:351:4: warning: 2nd function call argument is an uninitialized value dbg_buf(elandev->last_read, transfer->actual_length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:46:5: note: expanded from macro 'dbg_buf' fp_dbg("%02x", buf[0]); \ ^~~~~~~~~~~~~~~~~~~~~~ ../../../../../../Projects/jhbuild/libfprint/libfprint/fpi-log.h:52:16: note: expanded from macro 'fp_dbg' #define fp_dbg g_debug ^ libfprint/drivers/elan.c:351:4: warning: The left operand of '<<' is a garbage value dbg_buf(elandev->last_read, transfer->actual_length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:48:27: note: expanded from macro 'dbg_buf' fp_dbg("%04x", buf[0] << 8 | buf[1]); \ ~~~~~~ ^ libfprint/drivers/elan.c:351:4: warning: The left operand of '<<' is a garbage value dbg_buf(elandev->last_read, transfer->actual_length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libfprint/drivers/elan.c:50:41: note: expanded from macro 'dbg_buf' fp_dbg("%04x... (%d bytes)", buf[0] << 8 | buf[1], len) ~~~~~~ ^ --- libfprint/drivers/elan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 3020f05..ed474b0 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -350,7 +350,7 @@ static void elan_cmd_cb(struct libusb_transfer *transfer, } else if (transfer->endpoint & LIBUSB_ENDPOINT_IN) { /* just finished receiving */ elandev->last_read = g_memdup(transfer->buffer, transfer->actual_length); - dbg_buf(elandev->last_read, transfer->actual_length); + dbg_buf(transfer->buffer, transfer->actual_length); elan_cmd_done(ssm); } else { /* just finished sending */