netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch -next] ax25: remove unneeded NULL test in ax_xmit()
@ 2015-03-05 17:48 Dan Carpenter
  2015-03-06  6:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-03-05 17:48 UTC (permalink / raw)
  To: David S. Miller
  Cc: Eric W. Biederman, Tom Gundersen, David Herrmann, netdev,
	kernel-janitors

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>

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;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-06  6:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 17:48 [patch -next] ax25: remove unneeded NULL test in ax_xmit() Dan Carpenter
2015-03-06  6:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).