myri10ge: fix an incorrect free for skb in myri10ge_sw_tso
[ Upstream commit b423e54ba965b4469b48e46fd16941f1e1701697 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
d90df6da50
commit
fa5ee7c423
@@ -2895,11 +2895,9 @@ static netdev_tx_t myri10ge_sw_tso(struct sk_buff *skb,
|
|||||||
status = myri10ge_xmit(curr, dev);
|
status = myri10ge_xmit(curr, dev);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
dev_kfree_skb_any(curr);
|
dev_kfree_skb_any(curr);
|
||||||
if (segs != NULL) {
|
skb_list_walk_safe(next, curr, next) {
|
||||||
curr = segs;
|
|
||||||
segs = next;
|
|
||||||
curr->next = NULL;
|
curr->next = NULL;
|
||||||
dev_kfree_skb_any(segs);
|
dev_kfree_skb_any(curr);
|
||||||
}
|
}
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user