Skip to contentSkip to conversation

netfilter: nf_log: Remove NULL check

PATCH Applied Shivani Bhardwaj 2 participants 2 messages Jun 11, 2016 – Jun 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nf_log: Remove NULL check

If 'logger' was NULL, there would be a direct jump to the label 'out', since it has already been checked for NULL, remove this unnecessary check.

---
 net/netfilter/nf_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_log.c +1 -1
index a5d41df..93236ab 100644
@@ -167,7 +167,7 @@ int nf_logger_find_get(int pf, enum nf_log_type type)
 	if (logger == NULL)
 		goto out;
 
-	if (logger && try_module_get(logger->me))
+	if (try_module_get(logger->me))
 		ret = 0;
 out:
 	rcu_read_unlock();
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 3 lines · Shivani Bhardwaj

If 'logger' was NULL, there would be a direct jump to the label 'out', since it has already been checked for NULL, remove this unnecessary check.

Applied, thanks Shivani.