Commit 8a5f9edc authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

staging: hv: fix counting of available buffer slots when send fails

Because the number of available buffer slots doesn't decrease for failed
sends, we should not call netvsc_xmit_completion(), which increase the
count of available slots. In this failed case, just free the memory is
enough.
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7db1d946
...@@ -190,7 +190,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) ...@@ -190,7 +190,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
} else { } else {
/* we are shutting down or bus overloaded, just drop packet */ /* we are shutting down or bus overloaded, just drop packet */
net->stats.tx_dropped++; net->stats.tx_dropped++;
netvsc_xmit_completion(packet); kfree(packet);
dev_kfree_skb_any(skb);
} }
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment