Merge tag 'arm-dt-6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / net / ipv4 / nexthop.c
index e459a39..853a75a 100644 (file)
@@ -1858,7 +1858,7 @@ static void __remove_nexthop_fib(struct net *net, struct nexthop *nh)
                /* __ip6_del_rt does a release, so do a hold here */
                fib6_info_hold(f6i);
                ipv6_stub->ip6_del_rt(net, f6i,
-                                     !net->ipv4.sysctl_nexthop_compat_mode);
+                                     !READ_ONCE(net->ipv4.sysctl_nexthop_compat_mode));
        }
 }
 
@@ -2361,7 +2361,8 @@ out:
        if (!rc) {
                nh_base_seq_inc(net);
                nexthop_notify(RTM_NEWNEXTHOP, new_nh, &cfg->nlinfo);
-               if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode)
+               if (replace_notify &&
+                   READ_ONCE(net->ipv4.sysctl_nexthop_compat_mode))
                        nexthop_replace_notify(net, new_nh, &cfg->nlinfo);
        }