]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: hv: fix the return status of netvsc_start_xmit()
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 1 Sep 2011 19:19:46 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 18:56:19 +0000 (11:56 -0700)
Fix the return status, so the upper layer will retry if transmission
fails.

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 81e3c496e28ec0a47247cea3929bba0f98895cd0..30b9c80e2009db8bbe2cd8a833ec0818b4d4b61d 100644 (file)
@@ -140,12 +140,12 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
                         (num_pages * sizeof(struct hv_page_buffer)) +
                         sizeof(struct rndis_filter_packet), GFP_ATOMIC);
        if (!packet) {
-               /* out of memory, silently drop packet */
+               /* out of memory, drop packet */
                netdev_err(net, "unable to allocate hv_netvsc_packet\n");
 
                dev_kfree_skb(skb);
                net->stats.tx_dropped++;
-               return NETDEV_TX_OK;
+               return NETDEV_TX_BUSY;
        }
 
        packet->extension = (void *)(unsigned long)packet +
@@ -194,7 +194,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
                dev_kfree_skb_any(skb);
        }
 
-       return NETDEV_TX_OK;
+       return ret ? NETDEV_TX_BUSY : NETDEV_TX_OK;
 }
 
 /*