net: myri10ge: use skb_list_walk_safe helper for gso segments
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 8 Jan 2020 21:59:08 +0000 (16:59 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Jan 2020 23:19:55 +0000 (15:19 -0800)
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 <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/myricom/myri10ge/myri10ge.c

index c979f38a2e0cb5e758b15d36b9072002a73a0e27..2ee0d0be113a7bd19f2a9bb756c12dbe4d0c51b0 100644 (file)
@@ -2892,7 +2892,7 @@ drop:
 static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
                                         struct net_device *dev)
 {
-       struct sk_buff *segs, *curr;
+       struct sk_buff *segs, *curr, *next;
        struct myri10ge_priv *mgp = netdev_priv(dev);
        struct myri10ge_slice_state *ss;
        netdev_tx_t status;
@@ -2901,10 +2901,8 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
        if (IS_ERR(segs))
                goto drop;
 
-       while (segs) {
-               curr = segs;
-               segs = segs->next;
-               curr->next = NULL;
+       skb_list_walk_safe(segs, curr, next) {
+               skb_mark_not_on_list(curr);
                status = myri10ge_xmit(curr, dev);
                if (status != 0) {
                        dev_kfree_skb_any(curr);