]> www.infradead.org Git - users/hch/block.git/commitdiff
usb: usbtmc: uninitialized symbol 'actual' in usbtmc_read
authorGuido Kiener <guido.kiener@rohde-schwarz.com>
Mon, 24 Sep 2018 23:30:30 +0000 (01:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:12:08 +0000 (15:12 +0200)
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")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usbtmc.c

index dfbcf418dad75ed975fec66855cf7fb6f70b925e..9cb90603f71f81ab6b2f30e96ed06cb4cc8c1518 100644 (file)
@@ -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,