[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150305174846.GA17072@mwanda>
Date: Thu, 5 Mar 2015 20:48:46 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "David S. Miller" <davem@...emloft.net>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Tom Gundersen <teg@...m.no>,
David Herrmann <dh.herrmann@...il.com>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch -next] ax25: remove unneeded NULL test in ax_xmit()
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@...cle.com>
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 17058c4..2ffbf13 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -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;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists