提交 178c28b5 编写于 作者: X Xiaomeng Tong 提交者: Zheng Zengkai

myri10ge: fix an incorrect free for skb in myri10ge_sw_tso

stable inclusion
from stable-v5.10.112
commit fa5ee7c4232cc9976c0db483b914519639de75dc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fa5ee7c4232cc9976c0db483b914519639de75dc

--------------------------------

[ Upstream commit b423e54b ]

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: NXiaomeng Tong <xiam0nd.tong@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 b7fdd088
......@@ -2901,11 +2901,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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册