diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 2d9ef533cc48..ea091bc5ff09 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -826,7 +826,6 @@ int netvsc_send(struct hv_device *device, | |||
826 | u16 q_idx = packet->q_idx; | 826 | u16 q_idx = packet->q_idx; |
827 | u32 pktlen = packet->total_data_buflen, msd_len = 0; | 827 | u32 pktlen = packet->total_data_buflen, msd_len = 0; |
828 | unsigned int section_index = NETVSC_INVALID_INDEX; | 828 | unsigned int section_index = NETVSC_INVALID_INDEX; |
829 | struct sk_buff *skb = NULL; | ||
830 | unsigned long flag; | 829 | unsigned long flag; |
831 | struct multi_send_data *msdp; | 830 | struct multi_send_data *msdp; |
832 | struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; | 831 | struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; |
@@ -924,12 +923,8 @@ int netvsc_send(struct hv_device *device, | |||
924 | if (cur_send) | 923 | if (cur_send) |
925 | ret = netvsc_send_pkt(cur_send, net_device); | 924 | ret = netvsc_send_pkt(cur_send, net_device); |
926 | 925 | ||
927 | if (ret != 0) { | 926 | if (ret != 0 && section_index != NETVSC_INVALID_INDEX) |
928 | if (section_index != NETVSC_INVALID_INDEX) | 927 | netvsc_free_send_slot(net_device, section_index); |
929 | netvsc_free_send_slot(net_device, section_index); | ||
930 | } else if (skb) { | ||
931 | dev_kfree_skb_any(skb); | ||
932 | } | ||
933 | 928 | ||
934 | return ret; | 929 | return ret; |
935 | } | 930 | } |