Skip to content

Commit 536577f

Browse files
zx2c4davem330
authored andcommitted
net: myri10ge: use skb_list_walk_safe helper for gso segments
This is a straight-forward conversion case for the new function, and while we're at it, we can remove a null write to skb->next by replacing it with skb_mark_not_on_list. Signed-off-by: Jason A. Donenfeld <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 69b4ed5 commit 536577f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,7 +2892,7 @@ static netdev_tx_t myri10ge_xmit(struct sk_buff *skb,
28922892
static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
28932893
struct net_device *dev)
28942894
{
2895-
struct sk_buff *segs, *curr;
2895+
struct sk_buff *segs, *curr, *next;
28962896
struct myri10ge_priv *mgp = netdev_priv(dev);
28972897
struct myri10ge_slice_state *ss;
28982898
netdev_tx_t status;
@@ -2901,10 +2901,8 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
29012901
if (IS_ERR(segs))
29022902
goto drop;
29032903

2904-
while (segs) {
2905-
curr = segs;
2906-
segs = segs->next;
2907-
curr->next = NULL;
2904+
skb_list_walk_safe(segs, curr, next) {
2905+
skb_mark_not_on_list(curr);
29082906
status = myri10ge_xmit(curr, dev);
29092907
if (status != 0) {
29102908
dev_kfree_skb_any(curr);

0 commit comments

Comments
 (0)