failover: change mtu has RTNL
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 27 Jul 2018 20:43:21 +0000 (13:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 19:57:26 +0000 (12:57 -0700)
When changing MTU, RTNL is held so use rtnl_dereference
instead of rcu_dereference.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/net_failover.c

index d00d42c..7ae1856 100644 (file)
@@ -220,14 +220,14 @@ static int net_failover_change_mtu(struct net_device *dev, int new_mtu)
        struct net_device *primary_dev, *standby_dev;
        int ret = 0;
 
-       primary_dev = rcu_dereference(nfo_info->primary_dev);
+       primary_dev = rtnl_dereference(nfo_info->primary_dev);
        if (primary_dev) {
                ret = dev_set_mtu(primary_dev, new_mtu);
                if (ret)
                        return ret;
        }
 
-       standby_dev = rcu_dereference(nfo_info->standby_dev);
+       standby_dev = rtnl_dereference(nfo_info->standby_dev);
        if (standby_dev) {
                ret = dev_set_mtu(standby_dev, new_mtu);
                if (ret) {