@@ -1241,23 +1241,28 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt,
1241
1241
* If fib6_add_1 has cleared the old leaf pointer in the
1242
1242
* super-tree leaf node we have to find a new one for it.
1243
1243
*/
1244
- struct rt6_info * pn_leaf = rcu_dereference_protected (pn -> leaf ,
1245
- lockdep_is_held (& table -> tb6_lock ));
1246
- if (pn != fn && pn_leaf == rt ) {
1247
- pn_leaf = NULL ;
1248
- RCU_INIT_POINTER (pn -> leaf , NULL );
1249
- atomic_dec (& rt -> rt6i_ref );
1250
- }
1251
- if (pn != fn && !pn_leaf && !(pn -> fn_flags & RTN_RTINFO )) {
1252
- pn_leaf = fib6_find_prefix (info -> nl_net , table , pn );
1253
- #if RT6_DEBUG >= 2
1254
- if (!pn_leaf ) {
1255
- WARN_ON (!pn_leaf );
1256
- pn_leaf = info -> nl_net -> ipv6 .ip6_null_entry ;
1244
+ if (pn != fn ) {
1245
+ struct rt6_info * pn_leaf =
1246
+ rcu_dereference_protected (pn -> leaf ,
1247
+ lockdep_is_held (& table -> tb6_lock ));
1248
+ if (pn_leaf == rt ) {
1249
+ pn_leaf = NULL ;
1250
+ RCU_INIT_POINTER (pn -> leaf , NULL );
1251
+ atomic_dec (& rt -> rt6i_ref );
1257
1252
}
1253
+ if (!pn_leaf && !(pn -> fn_flags & RTN_RTINFO )) {
1254
+ pn_leaf = fib6_find_prefix (info -> nl_net , table ,
1255
+ pn );
1256
+ #if RT6_DEBUG >= 2
1257
+ if (!pn_leaf ) {
1258
+ WARN_ON (!pn_leaf );
1259
+ pn_leaf =
1260
+ info -> nl_net -> ipv6 .ip6_null_entry ;
1261
+ }
1258
1262
#endif
1259
- atomic_inc (& pn_leaf -> rt6i_ref );
1260
- rcu_assign_pointer (pn -> leaf , pn_leaf );
1263
+ atomic_inc (& pn_leaf -> rt6i_ref );
1264
+ rcu_assign_pointer (pn -> leaf , pn_leaf );
1265
+ }
1261
1266
}
1262
1267
#endif
1263
1268
goto failure ;
0 commit comments