Skip to contentSkip to conversation

IPVS for v4.3

GIT PULL Applied Simon Horman 2 participants 3 messages Jul 10, 2015 – Jul 15, 2015

Subsystems (4)
lore
Share & tools
lore

Simon Horman

author maintainer
#0 lore raw

please consider this cleanup from Markus Elfring which removes a redundant check before calling module_put().

Markus Elfring (1):
net-ipvs: Delete an unnecessary check before the function call
"module_put"

 net/netfilter/ipvs/ip_vs_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.1.4
author maintainer
#1 lore raw

PATCH 1/1 net-ipvs: Delete an unnecessary check before the function call "module_put"

From: Markus Elfring <[email protected]>

The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

---
 net/netfilter/ipvs/ip_vs_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/ipvs/ip_vs_sched.c +1 -1
index 199760c71f39..e50221b9d95f 100644
@@ -137,7 +137,7 @@ struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name)
 
 void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler)
 {
-	if (scheduler && scheduler->module)
+	if (scheduler)
 		module_put(scheduler->module);
 }
 
Signature · 1 line
2.1.4
maintainer Applied
#2 lore raw

Re: [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put"

Quoted 9 lines · Simon Horman

From: Markus Elfring <[email protected]>

The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Applied, thanks Simon.