netvsc: need rcu_derefence when accessing internal device info

The netvsc_device structure should be accessed by rcu_dereference
in the send path.  Change arguments to netvsc_send() to make
this easier to do correctly.

Remove no longer needed hv_device_to_netvsc_device.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
stephen hemminger
2017-07-19 11:53:17 -07:00
committed by David S. Miller
parent 9749fed5d4
commit 2a926f7912
4 changed files with 11 additions and 13 deletions

View File

@@ -505,8 +505,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
/* timestamp packet in software */
skb_tx_timestamp(skb);
ret = netvsc_send(net_device_ctx->device_ctx, packet,
rndis_msg, &pb, skb);
ret = netvsc_send(net_device_ctx, packet, rndis_msg, &pb, skb);
if (likely(ret == 0))
return NETDEV_TX_OK;