net/hyperv: fix erroneous NETDEV_TX_BUSY use
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 14 Mar 2012 08:53:34 +0000 (08:53 +0000)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 2 Apr 2012 20:25:39 +0000 (13:25 -0700)
commit20b6f1fc64e4e7e1ee121b39e7b774312b0ec56b
tree6cc1e70f39b1f9ebd51315a55ecddead2e647829
parentb3b89836f1c86c6fceae9799c2e6a4969df30aaa
net/hyperv: fix erroneous NETDEV_TX_BUSY use

A driver start_xmit() method cannot free skb and return NETDEV_TX_BUSY,
since caller is going to reuse freed skb.

This is mostly a revert of commit bf769375c (staging: hv: fix the return
status of netvsc_start_xmit())

In fact netif_tx_stop_queue() / netif_stop_queue() is needed before
returning NETDEV_TX_BUSY or you can trigger a ksoftirqd fatal loop.

In case of memory allocation error, only safe way is to drop the packet
and return NETDEV_TX_OK

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bb6d5e76fb4fba9aa36726db41404512f3286c0f)

Signed-off-by: Andy Whitcroft <apw@canonical.com>
drivers/net/hyperv/netvsc_drv.c