Commit 86dc1ad2 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

pktgen: remove some pointless conditionals before kfree_skb()

Remove some pointless conditionals before kfree_skb().
Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f961068
...@@ -3275,7 +3275,6 @@ static void pktgen_stop(struct pktgen_thread *t) ...@@ -3275,7 +3275,6 @@ static void pktgen_stop(struct pktgen_thread *t)
list_for_each_entry(pkt_dev, &t->if_list, list) { list_for_each_entry(pkt_dev, &t->if_list, list) {
pktgen_stop_device(pkt_dev); pktgen_stop_device(pkt_dev);
if (pkt_dev->skb)
kfree_skb(pkt_dev->skb); kfree_skb(pkt_dev->skb);
pkt_dev->skb = NULL; pkt_dev->skb = NULL;
...@@ -3303,7 +3302,6 @@ static void pktgen_rem_one_if(struct pktgen_thread *t) ...@@ -3303,7 +3302,6 @@ static void pktgen_rem_one_if(struct pktgen_thread *t)
if (!cur->removal_mark) if (!cur->removal_mark)
continue; continue;
if (cur->skb)
kfree_skb(cur->skb); kfree_skb(cur->skb);
cur->skb = NULL; cur->skb = NULL;
...@@ -3328,7 +3326,6 @@ static void pktgen_rem_all_ifs(struct pktgen_thread *t) ...@@ -3328,7 +3326,6 @@ static void pktgen_rem_all_ifs(struct pktgen_thread *t)
list_for_each_safe(q, n, &t->if_list) { list_for_each_safe(q, n, &t->if_list) {
cur = list_entry(q, struct pktgen_dev, list); cur = list_entry(q, struct pktgen_dev, list);
if (cur->skb)
kfree_skb(cur->skb); kfree_skb(cur->skb);
cur->skb = NULL; cur->skb = NULL;
...@@ -3393,7 +3390,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) ...@@ -3393,7 +3390,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
if (!netif_running(odev)) { if (!netif_running(odev)) {
pktgen_stop_device(pkt_dev); pktgen_stop_device(pkt_dev);
if (pkt_dev->skb)
kfree_skb(pkt_dev->skb); kfree_skb(pkt_dev->skb);
pkt_dev->skb = NULL; pkt_dev->skb = NULL;
goto out; goto out;
...@@ -3415,7 +3411,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) ...@@ -3415,7 +3411,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
if ((++pkt_dev->clone_count >= pkt_dev->clone_skb) if ((++pkt_dev->clone_count >= pkt_dev->clone_skb)
|| (!pkt_dev->skb)) { || (!pkt_dev->skb)) {
/* build a new pkt */ /* 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); pkt_dev->skb = fill_packet(odev, pkt_dev);
...@@ -3498,7 +3493,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) ...@@ -3498,7 +3493,6 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
/* Done with this */ /* Done with this */
pktgen_stop_device(pkt_dev); pktgen_stop_device(pkt_dev);
if (pkt_dev->skb)
kfree_skb(pkt_dev->skb); kfree_skb(pkt_dev->skb);
pkt_dev->skb = NULL; pkt_dev->skb = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment