ax25: remove unneeded NULL test in ax_xmit()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Mar 2015 17:48:46 +0000 (20:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Mar 2015 02:50:42 +0000 (21:50 -0500)
We get a static checker warning here on devel kernels:

drivers/net/hamradio/mkiss.c:560 ax_xmit()
warn: variable dereferenced before check 'skb' (see line 532)

It turns out that the NULL check can be deleted.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/mkiss.c

index 17058c490b7991da485546eb52e9177dc7696efc..2ffbf13471d09ad4c27d8c70fbb4dd3145befa75 100644 (file)
@@ -557,11 +557,9 @@ static netdev_tx_t ax_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        /* We were not busy, so we are now... :-) */
-       if (skb != NULL) {
-               netif_stop_queue(dev);
-               ax_encaps(dev, skb->data, skb->len);
-               kfree_skb(skb);
-       }
+       netif_stop_queue(dev);
+       ax_encaps(dev, skb->data, skb->len);
+       kfree_skb(skb);
 
        return NETDEV_TX_OK;
 }