staging: hv: fix counting of available buffer slots when send fails
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 1 Sep 2011 19:19:45 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 18:56:19 +0000 (11:56 -0700)
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>
drivers/staging/hv/netvsc_drv.c

index b49a08f4ed5acb9882df436bdcd5be5b31fff2c8..81e3c496e28ec0a47247cea3929bba0f98895cd0 100644 (file)
@@ -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;