diff options
author | Anton Protopopov <a.s.protopopov@gmail.com> | 2016-02-06 23:31:19 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-02-08 07:05:02 -0500 |
commit | 5cc6ce9ff27565949a1001a2889a8dd9fd09e772 (patch) | |
tree | d79edaa806b1799a965ae2c72b4c6bee4b48ab80 /net/netfilter | |
parent | 08a7f5d3f5c38ed745c3e99ee91975f20562d272 (diff) |
netfilter: nft_counter: fix erroneous return values
The nft_counter_init() and nft_counter_clone() functions should return
negative error value -ENOMEM instead of positive ENOMEM.
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nft_counter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nft_counter.c b/net/netfilter/nft_counter.c index c7808fc19719..c9743f78f219 100644 --- a/net/netfilter/nft_counter.c +++ b/net/netfilter/nft_counter.c | |||
@@ -100,7 +100,7 @@ static int nft_counter_init(const struct nft_ctx *ctx, | |||
100 | 100 | ||
101 | cpu_stats = netdev_alloc_pcpu_stats(struct nft_counter_percpu); | 101 | cpu_stats = netdev_alloc_pcpu_stats(struct nft_counter_percpu); |
102 | if (cpu_stats == NULL) | 102 | if (cpu_stats == NULL) |
103 | return ENOMEM; | 103 | return -ENOMEM; |
104 | 104 | ||
105 | preempt_disable(); | 105 | preempt_disable(); |
106 | this_cpu = this_cpu_ptr(cpu_stats); | 106 | this_cpu = this_cpu_ptr(cpu_stats); |
@@ -138,7 +138,7 @@ static int nft_counter_clone(struct nft_expr *dst, const struct nft_expr *src) | |||
138 | cpu_stats = __netdev_alloc_pcpu_stats(struct nft_counter_percpu, | 138 | cpu_stats = __netdev_alloc_pcpu_stats(struct nft_counter_percpu, |
139 | GFP_ATOMIC); | 139 | GFP_ATOMIC); |
140 | if (cpu_stats == NULL) | 140 | if (cpu_stats == NULL) |
141 | return ENOMEM; | 141 | return -ENOMEM; |
142 | 142 | ||
143 | preempt_disable(); | 143 | preempt_disable(); |
144 | this_cpu = this_cpu_ptr(cpu_stats); | 144 | this_cpu = this_cpu_ptr(cpu_stats); |