diff mbox series

[4/4] usb: usbtmc: uninitialized symbol 'actual' in usbtmc_ioctl_abort_bulk_in_tag

Message ID 20180924233032.2379-5-guido@kiener-muenchen.de (mailing list archive)
State New, archived
Headers show
Series usb: usbtmc: Fix changes for compatible IVI/VISA library | expand

Commit Message

Guido Kiener Sept. 24, 2018, 11:30 p.m. UTC
From: Guido Kiener <guido.kiener@rohde-schwarz.com>

Fix uninitialized symbol 'actual' in function
usbtmc_ioctl_abort_bulk_in_tag().

When symbol 'actual' is not initialized and usb_bulk_msg() fails,
the subsequent kernel debug message shows invalid data.

Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
Fixes: cbe743f1333b ("usb: usbtmc: Fix ioctl USBTMC_IOCTL_ABORT_BULK_IN")
---
 drivers/usb/class/usbtmc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 7184fa035434..4942122b2346 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -321,6 +321,7 @@  static int usbtmc_ioctl_abort_bulk_in_tag(struct usbtmc_device_data *data,
 	dev_dbg(dev, "Reading from bulk in EP\n");
 
 	/* Data must be present. So use low timeout 300 ms */
+	actual = 0;
 	rv = usb_bulk_msg(data->usb_dev,
 			  usb_rcvbulkpipe(data->usb_dev,
 					  data->bulk_in),