summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2009-02-25 00:16:08 +0000
committerDavid S. Miller <davem@davemloft.net>2009-02-26 23:07:30 -0800
commit1d2f8c950745f47f2937742eb886cffee439b754 (patch)
tree838292120aa46c3f3e46540f042354c034683739 /drivers/net
parent875b48297b8ab2f402680821da47d23bd6bddc55 (diff)
downloadlwn-1d2f8c950745f47f2937742eb886cffee439b754.tar.gz
lwn-1d2f8c950745f47f2937742eb886cffee439b754.zip
ppp: remove some pointless conditionals before kfree_skb()
Remove some pointless conditionals before kfree_skb(). Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ppp_async.c6
-rw-r--r--drivers/net/ppp_generic.c6
-rw-r--r--drivers/net/ppp_synctty.c3
3 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 6567fabd2e13..5de6fedd1d76 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -233,11 +233,9 @@ ppp_asynctty_close(struct tty_struct *tty)
tasklet_kill(&ap->tsk);
ppp_unregister_channel(&ap->chan);
- if (ap->rpkt)
- kfree_skb(ap->rpkt);
+ kfree_skb(ap->rpkt);
skb_queue_purge(&ap->rqueue);
- if (ap->tpkt)
- kfree_skb(ap->tpkt);
+ kfree_skb(ap->tpkt);
kfree(ap);
}
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ea8cdf8e4be8..42d455578453 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1245,8 +1245,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
return;
drop:
- if (skb)
- kfree_skb(skb);
+ kfree_skb(skb);
++ppp->dev->stats.tx_errors;
}
@@ -2658,8 +2657,7 @@ static void ppp_destroy_interface(struct ppp *ppp)
ppp->active_filter = NULL;
#endif /* CONFIG_PPP_FILTER */
- if (ppp->xmit_pending)
- kfree_skb(ppp->xmit_pending);
+ kfree_skb(ppp->xmit_pending);
free_netdev(ppp->dev);
}
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 1e892b7b1f8c..3ea791d16b00 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -281,8 +281,7 @@ ppp_sync_close(struct tty_struct *tty)
ppp_unregister_channel(&ap->chan);
skb_queue_purge(&ap->rqueue);
- if (ap->tpkt)
- kfree_skb(ap->tpkt);
+ kfree_skb(ap->tpkt);
kfree(ap);
}