]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/ipv6/netfilter/ip6_tables.c
netfilter: x_tables: pass xt_counters struct to counter allocator
[mirror_ubuntu-artful-kernel.git] / net / ipv6 / netfilter / ip6_tables.c
index 6ff42b8301ccca2ca237679d6fab41e80fe0cf49..a5a92083fd626f821fdd6d9315d47e739eebc168 100644 (file)
@@ -570,12 +570,9 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name,
        unsigned int j;
        struct xt_mtchk_param mtpar;
        struct xt_entry_match *ematch;
-       unsigned long pcnt;
 
-       pcnt = xt_percpu_counter_alloc();
-       if (IS_ERR_VALUE(pcnt))
+       if (!xt_percpu_counter_alloc(&e->counters))
                return -ENOMEM;
-       e->counters.pcnt = pcnt;
 
        j = 0;
        mtpar.net       = net;
@@ -612,7 +609,7 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name,
                cleanup_match(ematch, net);
        }
 
-       xt_percpu_counter_free(e->counters.pcnt);
+       xt_percpu_counter_free(&e->counters);
 
        return ret;
 }
@@ -699,8 +696,7 @@ static void cleanup_entry(struct ip6t_entry *e, struct net *net)
        if (par.target->destroy != NULL)
                par.target->destroy(&par);
        module_put(par.target->me);
-
-       xt_percpu_counter_free(e->counters.pcnt);
+       xt_percpu_counter_free(&e->counters);
 }
 
 /* Checks and translates the user-supplied table segment (held in