aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/ip6_fib.c4
-rw-r--r--net/ipv6/route.c9
2 files changed, 3 insertions, 10 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 6613d8dbb0e5..91247a6fc67f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -921,9 +921,7 @@ static void fib6_drop_pcpu_from(struct fib6_info *f6i,
921 if (pcpu_rt) { 921 if (pcpu_rt) {
922 struct fib6_info *from; 922 struct fib6_info *from;
923 923
924 from = rcu_dereference_protected(pcpu_rt->from, 924 from = xchg((__force struct fib6_info **)&pcpu_rt->from, NULL);
925 lockdep_is_held(&table->tb6_lock));
926 rcu_assign_pointer(pcpu_rt->from, NULL);
927 fib6_info_release(from); 925 fib6_info_release(from);
928 } 926 }
929 } 927 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b4899f0de0d0..2cc166bc978d 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -379,11 +379,8 @@ static void ip6_dst_destroy(struct dst_entry *dst)
379 in6_dev_put(idev); 379 in6_dev_put(idev);
380 } 380 }
381 381
382 rcu_read_lock(); 382 from = xchg((__force struct fib6_info **)&rt->from, NULL);
383 from = rcu_dereference(rt->from);
384 rcu_assign_pointer(rt->from, NULL);
385 fib6_info_release(from); 383 fib6_info_release(from);
386 rcu_read_unlock();
387} 384}
388 385
389static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, 386static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev,
@@ -1288,9 +1285,7 @@ static void rt6_remove_exception(struct rt6_exception_bucket *bucket,
1288 /* purge completely the exception to allow releasing the held resources: 1285 /* purge completely the exception to allow releasing the held resources:
1289 * some [sk] cache may keep the dst around for unlimited time 1286 * some [sk] cache may keep the dst around for unlimited time
1290 */ 1287 */
1291 from = rcu_dereference_protected(rt6_ex->rt6i->from, 1288 from = xchg((__force struct fib6_info **)&rt6_ex->rt6i->from, NULL);
1292 lockdep_is_held(&rt6_exception_lock));
1293 rcu_assign_pointer(rt6_ex->rt6i->from, NULL);
1294 fib6_info_release(from); 1289 fib6_info_release(from);
1295 dst_dev_put(&rt6_ex->rt6i->dst); 1290 dst_dev_put(&rt6_ex->rt6i->dst);
1296 1291