Skip to content

Commit

Permalink
ems_usb: cleanup: remove uneeded check
Browse files Browse the repository at this point in the history
"skb" is alway non-null here, but even if it were null the check isn't
needed because dev_kfree_skb() can handle it.

This eliminates a smatch warning about dereferencing a variable before
checking that it is non-null.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Mar 7, 2010
1 parent 02a780c commit ea3fb37
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,7 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
return NETDEV_TX_OK;

nomem:
if (skb)
dev_kfree_skb(skb);

dev_kfree_skb(skb);
stats->tx_dropped++;

return NETDEV_TX_OK;
Expand Down

0 comments on commit ea3fb37

Please sign in to comment.