summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorXiaomeng Tong <xiam0nd.tong@gmail.com>2022-04-06 06:55:56 +0300
committerDavid S. Miller <davem@davemloft.net>2022-04-06 17:29:18 +0300
commitb423e54ba965b4469b48e46fd16941f1e1701697 (patch)
treeebbcc7337dab250bf0a9b15f99dfac2ae919b6f2 /drivers/net
parentafb8e246527536848b9b4025b40e613edf776a9d (diff)
downloadlinux-b423e54ba965b4469b48e46fd16941f1e1701697.tar.xz
myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
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 <xiam0nd.tong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/myricom/myri10ge/myri10ge.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 50ac3ee2577a..21d2645885ce 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -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;
}