summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2024-01-29 20:24:24 +0100
committerFlorian Westphal <fw@strlen.de>2024-02-21 11:57:11 +0100
commit79578be4d35c842a802487e2f31c2aed80cc005f (patch)
tree80b8cbd2803092622b79ed31ed121e1574b68bcf /net/netfilter
parentaa23cfe6ab500dbbfa630602b403f433522daf9f (diff)
downloadlinux-79578be4d35c842a802487e2f31c2aed80cc005f.tar.gz
linux-79578be4d35c842a802487e2f31c2aed80cc005f.tar.bz2
linux-79578be4d35c842a802487e2f31c2aed80cc005f.zip
netfilter: nf_log: consolidate check for NULL logger in lookup function
Consolidate pointer fetch to logger and check for NULL in __find_logger(). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index e16f158388bb..e0bfeb75766f 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -31,10 +31,10 @@ static struct nf_logger *__find_logger(int pf, const char *str_logger)
int i;
for (i = 0; i < NF_LOG_TYPE_MAX; i++) {
- if (loggers[pf][i] == NULL)
+ log = nft_log_dereference(loggers[pf][i]);
+ if (!log)
continue;
- log = nft_log_dereference(loggers[pf][i]);
if (!strncasecmp(str_logger, log->name, strlen(log->name)))
return log;
}