Commit 37a0be86 authored by Dexuan Cui's avatar Dexuan Cui Committed by Greg Kroah-Hartman

hv_netvsc: Fix a warning of suspicious RCU usage

[ Upstream commit 6d0d779d ]

This fixes a warning of "suspicious rcu_dereference_check() usage"
when nload runs.

Fixes: 776e726b ("netvsc: fix RCU warning in get_stats")
Signed-off-by: default avatarDexuan Cui <>
Signed-off-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarSasha Levin <>
parent 936315c0
......@@ -1239,12 +1239,15 @@ 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_rtnl(ndev_ctx->nvdev);
struct netvsc_device *nvdev;
struct netvsc_vf_pcpu_stats vf_tot;
int i;
nvdev = rcu_dereference(ndev_ctx->nvdev);
if (!nvdev)
goto out;
netdev_stats_to_stats64(t, &net->stats);
......@@ -1283,6 +1286,8 @@ static void netvsc_get_stats64(struct net_device *net,
t->rx_packets += packets;
t->multicast += multicast;
static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment