* [patch] ems_usb: cleanup: remove uneeded check
@ 2010-03-06 11:11 Dan Carpenter
2010-03-07 23:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-06 11:11 UTC (permalink / raw)
To: kernel-janitors
"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>
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 11c8784..3345109 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] ems_usb: cleanup: remove uneeded check
2010-03-06 11:11 [patch] ems_usb: cleanup: remove uneeded check Dan Carpenter
@ 2010-03-07 23:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-03-07 23:28 UTC (permalink / raw)
To: error27
Cc: urs.thuermann, oliver.hartkopp, wg, haas, kurt.van.dijck, netdev,
kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Sat, 6 Mar 2010 14:11:38 +0300
> "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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-07 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 11:11 [patch] ems_usb: cleanup: remove uneeded check Dan Carpenter
2010-03-07 23:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox