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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Guido Kiener <guido.kiener@xxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxx>
Fixes: d7604ff0dc01 ("usb: usbtmc: Optimize usbtmc_read")
---
 drivers/usb/class/usbtmc.c | 1 +
 1 file changed, 1 insertion(+)

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,
-- 
2.17.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux