staging: wilc1000: fixes variable dereferenced before check
authorLeo Kim <leo.kim@atmel.com>
Thu, 4 Feb 2016 09:15:40 +0000 (18:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 01:34:58 +0000 (17:34 -0800)
This patch fixes the warning reported by smatch.
 - wilc_wlan_get_firmware() warn: variable dereferenced before check 'vif'
 - wilc_set_multicast_list() warn: variable dereferenced before check 'dev'

Just delete them and no need add null check since they are net_device from
ndo_set_rx_mode of net_device_ops and vif of netdev_priv.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c

index 9ca335367b8686ef32674b66d0dbe05ee2fa904b..22a2f98cc2fe2fe5864142cb887d7ceaa5617951 100644 (file)
@@ -397,9 +397,6 @@ int wilc_wlan_get_firmware(struct net_device *dev)
 
        netdev_info(dev, "loading firmware %s\n", firmware);
 
-       if (!vif)
-               goto _fail_;
-
        if (!(&vif->ndev->dev))
                goto _fail_;
 
@@ -1017,9 +1014,6 @@ static void wilc_set_multicast_list(struct net_device *dev)
        vif = netdev_priv(dev);
        hif_drv = (struct host_if_drv *)priv->hif_drv;
 
-       if (!dev)
-               return;
-
        if (dev->flags & IFF_PROMISC)
                return;