usb: class: usbtmc.c: Cleaning up uninitialized variables
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sun, 1 Jun 2014 13:43:19 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 22:59:10 +0000 (15:59 -0700)
There is a risk that the variable will be used without being initialized.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/usbtmc.c

index 103a6e9ee49d0a473bf29037a352f043a07c6068..ec978408a2ee324bfaae685aaac40c36514cbd81 100644 (file)
@@ -715,7 +715,7 @@ static int usbtmc_ioctl_clear(struct usbtmc_device_data *data)
        u8 *buffer;
        int rv;
        int n;
-       int actual;
+       int actual = 0;
        int max_size;
 
        dev = &data->intf->dev;