瀏覽代碼

netvsc: fix RCU warning in get_stats

The statistics functionis called with RTNL held during probe
but with RCU held during access from /proc and elsewhere.
This is safe so update the lockdep annotation.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
stephen hemminger 8 年之前
父節點
當前提交
776e726bfb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/net/hyperv/netvsc_drv.c

+ 1 - 1
drivers/net/hyperv/netvsc_drv.c

@@ -943,7 +943,7 @@ static void netvsc_get_stats64(struct net_device *net,
 			       struct rtnl_link_stats64 *t)
 {
 	struct net_device_context *ndev_ctx = netdev_priv(net);
-	struct netvsc_device *nvdev = rcu_dereference(ndev_ctx->nvdev);
+	struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev);
 	int i;
 
 	if (!nvdev)