File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -2607,21 +2607,19 @@ static int ip6_dst_gc(struct dst_ops *ops)
2607
2607
static int ip6_convert_metrics (struct net * net , struct fib6_info * rt ,
2608
2608
struct fib6_config * cfg )
2609
2609
{
2610
- int err = 0 ;
2610
+ struct dst_metrics * p ;
2611
2611
2612
- if (cfg -> fc_mx ) {
2613
- rt -> fib6_metrics = kzalloc (sizeof (* rt -> fib6_metrics ),
2614
- GFP_KERNEL );
2615
- if (unlikely (!rt -> fib6_metrics ))
2616
- return - ENOMEM ;
2612
+ if (!cfg -> fc_mx )
2613
+ return 0 ;
2617
2614
2618
- refcount_set (& rt -> fib6_metrics -> refcnt , 1 );
2615
+ p = kzalloc (sizeof (* rt -> fib6_metrics ), GFP_KERNEL );
2616
+ if (unlikely (!p ))
2617
+ return - ENOMEM ;
2619
2618
2620
- err = ip_metrics_convert (net , cfg -> fc_mx , cfg -> fc_mx_len ,
2621
- rt -> fib6_metrics -> metrics );
2622
- }
2619
+ refcount_set (& p -> refcnt , 1 );
2620
+ rt -> fib6_metrics = p ;
2623
2621
2624
- return err ;
2622
+ return ip_metrics_convert ( net , cfg -> fc_mx , cfg -> fc_mx_len , p -> metrics ) ;
2625
2623
}
2626
2624
2627
2625
static struct rt6_info * ip6_nh_lookup_table (struct net * net ,
You can’t perform that action at this time.
0 commit comments