Skip to content

Commit

Permalink
myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
Browse files Browse the repository at this point in the history
All remaining skbs should be released when myri10ge_xmit fails to
transmit a packet. Fix it within another skb_list_walk_safe.

Signed-off-by: Xiaomeng Tong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Xiaomeng Tong authored and davem330 committed Apr 6, 2022
1 parent afb8e24 commit b423e54
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/myricom/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -2903,11 +2903,9 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
status = myri10ge_xmit(curr, dev);
if (status != 0) {
dev_kfree_skb_any(curr);
if (segs != NULL) {
curr = segs;
segs = next;
skb_list_walk_safe(next, curr, next) {
curr->next = NULL;
dev_kfree_skb_any(segs);
dev_kfree_skb_any(curr);
}
goto drop;
}
Expand Down

0 comments on commit b423e54

Please sign in to comment.