diff options
author | 2017-07-19 11:53:17 -0700 | |
---|---|---|
committer | 2017-07-19 22:20:05 -0700 | |
commit | 2a926f791211b40ba114f45e0e7bfefd2fac5d30 (patch) | |
tree | 3cd3b15122daed0f09c4cbb410d580e7f1a34b6b /drivers/net/hyperv/hyperv_net.h | |
parent | netvsc: use ERR_PTR to avoid dereference issues (diff) | |
download | linux-2a926f791211b40ba114f45e0e7bfefd2fac5d30.tar.gz linux-2a926f791211b40ba114f45e0e7bfefd2fac5d30.tar.bz2 linux-2a926f791211b40ba114f45e0e7bfefd2fac5d30.zip |
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>
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index e620374727c8..0054b6929f6e 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -183,10 +183,12 @@ struct rndis_device { /* Interface */ struct rndis_message; struct netvsc_device; +struct net_device_context; + struct netvsc_device *netvsc_device_add(struct hv_device *device, const struct netvsc_device_info *info); void netvsc_device_remove(struct hv_device *device); -int netvsc_send(struct hv_device *device, +int netvsc_send(struct net_device_context *ndc, struct hv_netvsc_packet *packet, struct rndis_message *rndis_msg, struct hv_page_buffer **page_buffer, @@ -790,12 +792,6 @@ net_device_to_netvsc_device(struct net_device *ndev) return ((struct net_device_context *)netdev_priv(ndev))->nvdev; } -static inline struct netvsc_device * -hv_device_to_netvsc_device(struct hv_device *device) -{ - return net_device_to_netvsc_device(hv_get_drvdata(device)); -} - /* NdisInitialize message */ struct rndis_initialize_request { u32 req_id; |