media: usb: siano: Fix false-positive "uninitialized variable" warning
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 21 May 2019 15:38:07 +0000 (11:38 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:22:40 +0000 (12:22 +0200)
commit 45457c01171fd1488a7000d1751c06ed8560ee38 upstream.

GCC complains about an apparently uninitialized variable recently
added to smsusb_init_device().  It's a false positive, but to silence
the warning this patch adds a trivial initialization.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: kbuild test robot <lkp@intel.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/siano/smsusb.c

index 4e9180a1c66242792a9300b3e6c48f7e3df6dd09..fbc436e1a7d26eacaacaa82e3fe905b7eb17cf85 100644 (file)
@@ -402,7 +402,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
        struct smsusb_device_t *dev;
        void *mdev;
        int i, rc;
-       int in_maxp;
+       int in_maxp = 0;
 
        /* create device object */
        dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);