netfilter: nft_set_pipapo: release elements in clone only from destroy path
[sfrench/cifs-2.6.git] / net / netfilter / nft_set_pipapo.c
index c0ceea068936a64a60f208ddbacb5049847dc71b..df8de50902463738642d4d24b59f12b17b5ff726 100644 (file)
@@ -2329,8 +2329,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
        if (m) {
                rcu_barrier();
 
-               nft_set_pipapo_match_destroy(ctx, set, m);
-
                for_each_possible_cpu(cpu)
                        pipapo_free_scratch(m, cpu);
                free_percpu(m->scratch);
@@ -2342,8 +2340,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
        if (priv->clone) {
                m = priv->clone;
 
-               if (priv->dirty)
-                       nft_set_pipapo_match_destroy(ctx, set, m);
+               nft_set_pipapo_match_destroy(ctx, set, m);
 
                for_each_possible_cpu(cpu)
                        pipapo_free_scratch(priv->clone, cpu);