diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-07-19 20:53:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-20 07:20:05 +0200 |
commit | 79e8cbe7a789a0863cc6cd874872b4dd63ec5947 (patch) | |
tree | 742a12f0c68a5dbaff3e051f806dd1ca3effe4fe /drivers/net/hyperv/netvsc_drv.c | |
parent | netvsc: force link update after MTU change (diff) | |
download | linux-79e8cbe7a789a0863cc6cd874872b4dd63ec5947.tar.xz linux-79e8cbe7a789a0863cc6cd874872b4dd63ec5947.zip |
netvsc: add some rtnl_dereference annotations
In a couple places RTNL is held, and the netvsc_device pointer
is acquired without annotation.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 09b07ca9e69a..e8e82a6a4b1a 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -69,7 +69,7 @@ static void netvsc_set_multicast_list(struct net_device *net) static int netvsc_open(struct net_device *net) { struct net_device_context *ndev_ctx = netdev_priv(net); - struct netvsc_device *nvdev = ndev_ctx->nvdev; + struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev); struct rndis_device *rdev; int ret = 0; @@ -1364,7 +1364,7 @@ static struct net_device *get_netvsc_byref(struct net_device *vf_netdev) continue; /* not a netvsc device */ net_device_ctx = netdev_priv(dev); - if (net_device_ctx->nvdev == NULL) + if (!rtnl_dereference(net_device_ctx->nvdev)) continue; /* device is removed */ if (rtnl_dereference(net_device_ctx->vf_netdev) == vf_netdev) @@ -1589,7 +1589,8 @@ static int netvsc_remove(struct hv_device *dev) * removed. Also blocks mtu and channel changes. */ rtnl_lock(); - rndis_filter_device_remove(dev, ndev_ctx->nvdev); + rndis_filter_device_remove(dev, + rtnl_dereference(ndev_ctx->nvdev)); rtnl_unlock(); unregister_netdev(net); |