mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 04:30:52 +07:00
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>
This commit is contained in:
parent
08a7f5d3f5
commit
5cc6ce9ff2
@ -100,7 +100,7 @@ static int nft_counter_init(const struct nft_ctx *ctx,
|
||||
|
||||
cpu_stats = netdev_alloc_pcpu_stats(struct nft_counter_percpu);
|
||||
if (cpu_stats == NULL)
|
||||
return ENOMEM;
|
||||
return -ENOMEM;
|
||||
|
||||
preempt_disable();
|
||||
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)
|
||||
cpu_stats = __netdev_alloc_pcpu_stats(struct nft_counter_percpu,
|
||||
GFP_ATOMIC);
|
||||
if (cpu_stats == NULL)
|
||||
return ENOMEM;
|
||||
return -ENOMEM;
|
||||
|
||||
preempt_disable();
|
||||
this_cpu = this_cpu_ptr(cpu_stats);
|
||||
|
Loading…
Reference in New Issue
Block a user