@@ -390,14 +390,19 @@ static int u32_init(struct tcf_proto *tp)
390
390
return 0 ;
391
391
}
392
392
393
- static int u32_destroy_key (struct tc_u_knode * n , bool free_pf )
393
+ static void __u32_destroy_key (struct tc_u_knode * n )
394
394
{
395
395
struct tc_u_hnode * ht = rtnl_dereference (n -> ht_down );
396
396
397
397
tcf_exts_destroy (& n -> exts );
398
- tcf_exts_put_net (& n -> exts );
399
398
if (ht && -- ht -> refcnt == 0 )
400
399
kfree (ht );
400
+ kfree (n );
401
+ }
402
+
403
+ static void u32_destroy_key (struct tc_u_knode * n , bool free_pf )
404
+ {
405
+ tcf_exts_put_net (& n -> exts );
401
406
#ifdef CONFIG_CLS_U32_PERF
402
407
if (free_pf )
403
408
free_percpu (n -> pf );
@@ -406,8 +411,7 @@ static int u32_destroy_key(struct tc_u_knode *n, bool free_pf)
406
411
if (free_pf )
407
412
free_percpu (n -> pcpu_success );
408
413
#endif
409
- kfree (n );
410
- return 0 ;
414
+ __u32_destroy_key (n );
411
415
}
412
416
413
417
/* u32_delete_key_rcu should be called when free'ing a copied
@@ -903,13 +907,13 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
903
907
tca [TCA_RATE ], ovr , extack );
904
908
905
909
if (err ) {
906
- u32_destroy_key (new , false );
910
+ __u32_destroy_key (new );
907
911
return err ;
908
912
}
909
913
910
914
err = u32_replace_hw_knode (tp , new , flags , extack );
911
915
if (err ) {
912
- u32_destroy_key (new , false );
916
+ __u32_destroy_key (new );
913
917
return err ;
914
918
}
915
919
0 commit comments