Skip to content

Commit

Permalink
staging: hv: fix counting of available buffer slots when send fails
Browse files Browse the repository at this point in the history
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: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 7db1d94 commit 8a5f9ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/hv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
} else {
/* we are shutting down or bus overloaded, just drop packet */
net->stats.tx_dropped++;
netvsc_xmit_completion(packet);
kfree(packet);
dev_kfree_skb_any(skb);
}

return NETDEV_TX_OK;
Expand Down

0 comments on commit 8a5f9ed

Please sign in to comment.