* [GIT PULL nf-next] IPVS for v4.3
@ 2015-07-10 6:42 Simon Horman
2015-07-10 6:42 ` [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put" Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2015-07-10 6:42 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Simon Horman
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(-)
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put"
2015-07-10 6:42 [GIT PULL nf-next] IPVS for v4.3 Simon Horman
@ 2015-07-10 6:42 ` Simon Horman
2015-07-15 17:00 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2015-07-10 6:42 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Markus Elfring, Simon Horman
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c
index 199760c71f39..e50221b9d95f 100644
--- a/net/netfilter/ipvs/ip_vs_sched.c
+++ b/net/netfilter/ipvs/ip_vs_sched.c
@@ -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);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put"
2015-07-10 6:42 ` [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put" Simon Horman
@ 2015-07-15 17:00 ` Pablo Neira Ayuso
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2015-07-15 17:00 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov, Markus Elfring
On Fri, Jul 10, 2015 at 03:42:49PM +0900, Simon Horman wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
>
> 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.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> Signed-off-by: Simon Horman <horms@verge.net.au>
Applied, thanks Simon.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-15 16:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10 6:42 [GIT PULL nf-next] IPVS for v4.3 Simon Horman
2015-07-10 6:42 ` [PATCH nf-next] net-ipvs: Delete an unnecessary check before the function call "module_put" Simon Horman
2015-07-15 17:00 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).