From: Haiyang Zhang Date: Thu, 1 Sep 2011 19:19:44 +0000 (-0700) Subject: staging: hv: fix counting of #outstanding-sends in failed sends X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7db1d946c4db748b631fe4885110349cc259987f;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git staging: hv: fix counting of #outstanding-sends in failed sends If the packet failed to be sent, we shouldn't count it as the number of outstanding sends. Signed-off-by: Haiyang Zhang Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index 82b129b7775..efbc8a0913d 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c @@ -494,8 +494,9 @@ int netvsc_send(struct hv_device *device, if (ret != 0) netdev_err(ndev, "Unable to send packet %p ret %d\n", packet, ret); + else + atomic_inc(&net_device->num_outstanding_sends); - atomic_inc(&net_device->num_outstanding_sends); return ret; }