diff mbox series

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

Message ID 20180924233032.2379-3-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_read.

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

Signed-off-by: Guido Kiener <guido.kiener@rohde-schwarz.com>
Fixes: d7604ff0dc01 ("usb: usbtmc: Optimize usbtmc_read")
---
 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 dfbcf418dad7..9cb90603f71f 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1370,6 +1370,7 @@  static ssize_t usbtmc_read(struct file *filp, char __user *buf,
 
 	/* Loop until we have fetched everything we requested */
 	remaining = count;
+	actual = 0;
 
 	/* Send bulk URB */
 	retval = usb_bulk_msg(data->usb_dev,