From: KY Srinivasan Date: Mon, 30 Mar 2015 04:08:41 +0000 (-0700) Subject: hv_netvsc: Cleanup the test for freeing skb when we use sendbuf mechanism X-Git-Tag: v4.1-rc1~128^2~109^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cbacec76bcd03ff21b37ac331e652b5a8f3ea644;p=karo-tx-linux.git hv_netvsc: Cleanup the test for freeing skb when we use sendbuf mechanism In preparation for embedding the rndis state and other packet state into the skb, cleanup the test for freeing the skb. Signed-off-by: K. Y. Srinivasan Signed-off-by: David S. Miller --- diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index b81bd37d3afb..ecbd81385e96 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -870,6 +870,7 @@ int netvsc_send(struct hv_device *device, (unsigned long)packet->send_completion_tid; packet->page_buf_cnt = 0; + packet->send_completion_tid = 0; packet->send_buf_index = section_index; packet->total_data_buflen += msd_len; diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 0c998186039e..75beb89aac9c 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -234,11 +234,10 @@ static void netvsc_xmit_completion(void *context) struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context; struct sk_buff *skb = (struct sk_buff *) (unsigned long)packet->send_completion_tid; - u32 index = packet->send_buf_index; kfree(packet); - if (skb && (index == NETVSC_INVALID_INDEX)) + if (skb) dev_kfree_skb_any(skb); }