Skip to content

Commit

Permalink
ax25: remove unneeded NULL test in ax_xmit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Mar 7, 2015
1 parent f68a8eb commit feb27d1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/hamradio/mkiss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit feb27d1

Please sign in to comment.