diff options
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
| -rw-r--r-- | drivers/net/hyperv/netvsc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 9f49c0129a78..7cd4eb38abfa 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
| @@ -716,7 +716,7 @@ int netvsc_send(struct hv_device *device, | |||
| 716 | u64 req_id; | 716 | u64 req_id; |
| 717 | unsigned int section_index = NETVSC_INVALID_INDEX; | 717 | unsigned int section_index = NETVSC_INVALID_INDEX; |
| 718 | u32 msg_size = 0; | 718 | u32 msg_size = 0; |
| 719 | struct sk_buff *skb; | 719 | struct sk_buff *skb = NULL; |
| 720 | u16 q_idx = packet->q_idx; | 720 | u16 q_idx = packet->q_idx; |
| 721 | 721 | ||
| 722 | 722 | ||
| @@ -743,8 +743,6 @@ int netvsc_send(struct hv_device *device, | |||
| 743 | packet); | 743 | packet); |
| 744 | skb = (struct sk_buff *) | 744 | skb = (struct sk_buff *) |
| 745 | (unsigned long)packet->send_completion_tid; | 745 | (unsigned long)packet->send_completion_tid; |
| 746 | if (skb) | ||
| 747 | dev_kfree_skb_any(skb); | ||
| 748 | packet->page_buf_cnt = 0; | 746 | packet->page_buf_cnt = 0; |
| 749 | } | 747 | } |
| 750 | } | 748 | } |
| @@ -810,6 +808,13 @@ int netvsc_send(struct hv_device *device, | |||
| 810 | packet, ret); | 808 | packet, ret); |
| 811 | } | 809 | } |
| 812 | 810 | ||
| 811 | if (ret != 0) { | ||
| 812 | if (section_index != NETVSC_INVALID_INDEX) | ||
| 813 | netvsc_free_send_slot(net_device, section_index); | ||
| 814 | } else if (skb) { | ||
| 815 | dev_kfree_skb_any(skb); | ||
| 816 | } | ||
| 817 | |||
| 813 | return ret; | 818 | return ret; |
| 814 | } | 819 | } |
| 815 | 820 | ||
