diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-07-19 20:53:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-20 07:20:05 +0200 |
commit | 3962981f4822aaf284234efd0500041417faea86 (patch) | |
tree | 6a381394e3fc59e48bd531f3afd1ebb8f34d47a5 /drivers/net/hyperv/netvsc.c | |
parent | netvsc: save pointer to parent netvsc_device in channel table (diff) | |
download | linux-3962981f4822aaf284234efd0500041417faea86.tar.xz linux-3962981f4822aaf284234efd0500041417faea86.zip |
netvsc: add rtnl annotations in rndis
The rndis functions are used when changing device state.
Therefore the references from network device to internal state
are protected by RTNL mutex.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index c15640c6fd83..0a9d9feedc3f 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -105,7 +105,8 @@ static void netvsc_destroy_buf(struct hv_device *device) { struct nvsp_message *revoke_packet; struct net_device *ndev = hv_get_drvdata(device); - struct netvsc_device *net_device = net_device_to_netvsc_device(ndev); + struct net_device_context *ndc = netdev_priv(ndev); + struct netvsc_device *net_device = rtnl_dereference(ndc->nvdev); int ret; /* @@ -829,7 +830,8 @@ int netvsc_send(struct net_device_context *ndev_ctx, struct hv_page_buffer **pb, struct sk_buff *skb) { - struct netvsc_device *net_device = rcu_dereference(ndev_ctx->nvdev); + struct netvsc_device *net_device + = rcu_dereference_rtnl(ndev_ctx->nvdev); struct hv_device *device = ndev_ctx->device_ctx; int ret = 0; struct netvsc_channel *nvchan; |