aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nft_quota.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2022-01-10 20:48:17 +0100
committerJakub Kicinski <kuba@kernel.org>2022-01-10 21:09:43 -0800
commit51edb2ff1c6fc27d3fa73f0773a31597ecd8e230 (patch)
treedbba7f1c889cf6ca87766bdb671085caedb0cacc /net/netfilter/nft_quota.c
parentfe8152b38d3a994c4c6fdbc0cd6551d569a5715a (diff)
downloadlinux-51edb2ff1c6fc27d3fa73f0773a31597ecd8e230.tar.gz
netfilter: nf_tables: typo NULL check in _clone() function
This should check for NULL in case memory allocation fails. Reported-by: Julian Wiedmann <jwiedmann.dev@gmail.com> Fixes: 3b9e2ea6c11b ("netfilter: nft_limit: move stateful fields out of expression data") Fixes: 37f319f37d90 ("netfilter: nft_connlimit: move stateful fields out of expression data") Fixes: 33a24de37e81 ("netfilter: nft_last: move stateful fields out of expression data") Fixes: ed0a0c60f0e5 ("netfilter: nft_quota: move stateful fields out of expression data") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Link: https://lore.kernel.org/r/20220110194817.53481-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/netfilter/nft_quota.c')
-rw-r--r--net/netfilter/nft_quota.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_quota.c b/net/netfilter/nft_quota.c
index 0484aef74273b..f394a0b562f66 100644
--- a/net/netfilter/nft_quota.c
+++ b/net/netfilter/nft_quota.c
@@ -237,7 +237,7 @@ static int nft_quota_clone(struct nft_expr *dst, const struct nft_expr *src)
struct nft_quota *priv_dst = nft_expr_priv(dst);
priv_dst->consumed = kmalloc(sizeof(*priv_dst->consumed), GFP_ATOMIC);
- if (priv_dst->consumed)
+ if (!priv_dst->consumed)
return -ENOMEM;
atomic64_set(priv_dst->consumed, 0);