Skip to content

Commit

Permalink
hv_netvsc: Cleanup the test for freeing skb when we use sendbuf mecha…
Browse files Browse the repository at this point in the history
…nism

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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kattisrinivasan authored and davem330 committed Mar 31, 2015
1 parent 4e833c5 commit cbacec7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit cbacec7

Please sign in to comment.