ppp: remove some pointless conditionals before kfree_skb()
authorWei Yongjun <yjwei@cn.fujitsu.com>
Wed, 25 Feb 2009 00:16:08 +0000 (00:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Feb 2009 07:07:30 +0000 (23:07 -0800)
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>
drivers/net/ppp_async.c
drivers/net/ppp_generic.c
drivers/net/ppp_synctty.c

index 6567fabd2e132a4ab4296a8283d32632b299c9d0..5de6fedd1d769432567db02e902f3eabf2a5aad2 100644 (file)
@@ -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);
 }
 
index ea8cdf8e4be8b6696e57d1404ca3a19725ee9396..42d45557845323fb2475e04a59b7739a7a93c866 100644 (file)
@@ -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);
 }
index 1e892b7b1f8cf997764e7a29ffe09bbf745f69ff..3ea791d16b00110b5c9d44e2d4211cd7c401ab40 100644 (file)
@@ -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);
 }