提交 fbd4c7e7 编写于 作者: S stephen hemminger 提交者: David S. Miller

netvsc: fix rcu dereference warning from ethtool

The ethtool info command calls the netvsc get_sset_count with RTNL
but not with RCU. Which causes warning:

drivers/net/hyperv/netvsc_drv.c:1010 suspicious rcu_dereference_check() usage!
Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8397ed36
...@@ -1028,7 +1028,7 @@ static const struct { ...@@ -1028,7 +1028,7 @@ static const struct {
static int netvsc_get_sset_count(struct net_device *dev, int string_set) static int netvsc_get_sset_count(struct net_device *dev, int string_set)
{ {
struct net_device_context *ndc = netdev_priv(dev); struct net_device_context *ndc = netdev_priv(dev);
struct netvsc_device *nvdev = rcu_dereference(ndc->nvdev); struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev);
if (!nvdev) if (!nvdev)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册