usb: usbtmc: uninitialized symbol 'actual' in usbtmc_ioctl_clear
authorGuido Kiener <guido.kiener@rohde-schwarz.com>
Mon, 24 Sep 2018 23:30:31 +0000 (01:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:47:53 +0000 (18:47 +0100)
[ Upstream commit 9a83190300867fb024d53f47c31088e34188efc1 ]

Fix uninitialized symbol 'actual' in function usbtmc_ioctl_clear.

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: dfee02ac4bce ("usb: usbtmc: Fix ioctl USBTMC_IOCTL_CLEAR")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/class/usbtmc.c

index 3ce45c9..e6a7c86 100644 (file)
@@ -1016,6 +1016,7 @@ usbtmc_clear_check_status:
                do {
                        dev_dbg(dev, "Reading from bulk in EP\n");
 
+                       actual = 0;
                        rv = usb_bulk_msg(data->usb_dev,
                                          usb_rcvbulkpipe(data->usb_dev,
                                                          data->bulk_in),