aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-03-14 04:53:34 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-16 05:01:17 -0400
commitbb6d5e76fb4fba9aa36726db41404512f3286c0f (patch)
tree58858ab2c09fe9179dcf4c26da83bbd9c3783211 /drivers/net/hyperv
parent7bdd402706cf26bfef9050dfee3f229b7f33ee4f (diff)
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>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index bf01841bda5b..610860f28968 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -166,7 +166,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
166 166
167 dev_kfree_skb(skb); 167 dev_kfree_skb(skb);
168 net->stats.tx_dropped++; 168 net->stats.tx_dropped++;
169 return NETDEV_TX_BUSY; 169 return NETDEV_TX_OK;
170 } 170 }
171 171
172 packet->extension = (void *)(unsigned long)packet + 172 packet->extension = (void *)(unsigned long)packet +
@@ -226,7 +226,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
226 dev_kfree_skb_any(skb); 226 dev_kfree_skb_any(skb);
227 } 227 }
228 228
229 return ret ? NETDEV_TX_BUSY : NETDEV_TX_OK; 229 return NETDEV_TX_OK;
230} 230}
231 231
232/* 232/*