Commit ee90b812 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by David S. Miller

hv_netvsc: Fix the packet free when it is in skb headroom

In the two places changed, we now use netvsc_xmit_completion() which properly
frees hv_netvsc_packet in or not in skb headroom.
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72151422
...@@ -188,6 +188,7 @@ int netvsc_send(struct hv_device *device, ...@@ -188,6 +188,7 @@ int netvsc_send(struct hv_device *device,
struct hv_netvsc_packet *packet); struct hv_netvsc_packet *packet);
void netvsc_linkstatus_callback(struct hv_device *device_obj, void netvsc_linkstatus_callback(struct hv_device *device_obj,
struct rndis_message *resp); struct rndis_message *resp);
void netvsc_xmit_completion(void *context);
int netvsc_recv_callback(struct hv_device *device_obj, int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet, struct hv_netvsc_packet *packet,
struct ndis_tcp_ip_checksum_info *csum_info); struct ndis_tcp_ip_checksum_info *csum_info);
......
...@@ -878,7 +878,9 @@ int netvsc_send(struct hv_device *device, ...@@ -878,7 +878,9 @@ int netvsc_send(struct hv_device *device,
packet->send_buf_index = section_index; packet->send_buf_index = section_index;
packet->total_data_buflen += msd_len; packet->total_data_buflen += msd_len;
kfree(msdp->pkt); if (msdp->pkt)
netvsc_xmit_completion(msdp->pkt);
if (packet->xmit_more) { if (packet->xmit_more) {
msdp->pkt = packet; msdp->pkt = packet;
msdp->count++; msdp->count++;
...@@ -902,7 +904,7 @@ int netvsc_send(struct hv_device *device, ...@@ -902,7 +904,7 @@ int netvsc_send(struct hv_device *device,
if (m_ret != 0) { if (m_ret != 0) {
netvsc_free_send_slot(net_device, netvsc_free_send_slot(net_device,
msd_send->send_buf_index); msd_send->send_buf_index);
kfree(msd_send); netvsc_xmit_completion(msd_send);
} }
} }
......
...@@ -229,7 +229,7 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, ...@@ -229,7 +229,7 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
return q_idx; return q_idx;
} }
static void netvsc_xmit_completion(void *context) void netvsc_xmit_completion(void *context)
{ {
struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context; struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
struct sk_buff *skb = (struct sk_buff *) struct sk_buff *skb = (struct sk_buff *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment