pktgen: 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>
This commit is contained in:
parent
6f96106867
commit
86dc1ad2be
|
@ -3275,8 +3275,7 @@ static void pktgen_stop(struct pktgen_thread *t)
|
|||
|
||||
list_for_each_entry(pkt_dev, &t->if_list, list) {
|
||||
pktgen_stop_device(pkt_dev);
|
||||
if (pkt_dev->skb)
|
||||
kfree_skb(pkt_dev->skb);
|
||||
kfree_skb(pkt_dev->skb);
|
||||
|
||||
pkt_dev->skb = NULL;
|
||||
}
|
||||
|
@ -3303,8 +3302,7 @@ static void pktgen_rem_one_if(struct pktgen_thread *t)
|
|||
if (!cur->removal_mark)
|
||||
continue;
|
||||
|
||||
if (cur->skb)
|
||||
kfree_skb(cur->skb);
|
||||
kfree_skb(cur->skb);
|
||||
cur->skb = NULL;
|
||||
|
||||
pktgen_remove_device(t, cur);
|
||||
|
@ -3328,8 +3326,7 @@ static void pktgen_rem_all_ifs(struct pktgen_thread *t)
|
|||
list_for_each_safe(q, n, &t->if_list) {
|
||||
cur = list_entry(q, struct pktgen_dev, list);
|
||||
|
||||
if (cur->skb)
|
||||
kfree_skb(cur->skb);
|
||||
kfree_skb(cur->skb);
|
||||
cur->skb = NULL;
|
||||
|
||||
pktgen_remove_device(t, cur);
|
||||
|
@ -3393,8 +3390,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
|
|||
|
||||
if (!netif_running(odev)) {
|
||||
pktgen_stop_device(pkt_dev);
|
||||
if (pkt_dev->skb)
|
||||
kfree_skb(pkt_dev->skb);
|
||||
kfree_skb(pkt_dev->skb);
|
||||
pkt_dev->skb = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
@ -3415,8 +3411,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
|
|||
if ((++pkt_dev->clone_count >= pkt_dev->clone_skb)
|
||||
|| (!pkt_dev->skb)) {
|
||||
/* build a new pkt */
|
||||
if (pkt_dev->skb)
|
||||
kfree_skb(pkt_dev->skb);
|
||||
kfree_skb(pkt_dev->skb);
|
||||
|
||||
pkt_dev->skb = fill_packet(odev, pkt_dev);
|
||||
if (pkt_dev->skb == NULL) {
|
||||
|
@ -3498,8 +3493,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
|
|||
|
||||
/* Done with this */
|
||||
pktgen_stop_device(pkt_dev);
|
||||
if (pkt_dev->skb)
|
||||
kfree_skb(pkt_dev->skb);
|
||||
kfree_skb(pkt_dev->skb);
|
||||
pkt_dev->skb = NULL;
|
||||
}
|
||||
out:;
|
||||
|
|
Loading…
Reference in New Issue