diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-18 20:37:05 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-11-20 13:08:43 +0100 |
commit | 982f405136a44754e884184d24b70d2d4cefcb7a (patch) | |
tree | 859f3fc225ed106392df89500c2deac8de57326d /net/netfilter/ipvs/ip_vs_sched.c | |
parent | 2c7b5d5dac0ddaa4e1109fb84dbbe91db3c6c6e5 (diff) | |
download | op-kernel-dev-982f405136a44754e884184d24b70d2d4cefcb7a.zip op-kernel-dev-982f405136a44754e884184d24b70d2d4cefcb7a.tar.gz |
netfilter: Deletion of unnecessary checks before two function calls
The functions free_percpu() and module_put() test whether their argument
is NULL and then return 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>
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_sched.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_sched.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_sched.c b/net/netfilter/ipvs/ip_vs_sched.c index 4dbcda6..199760c 100644 --- a/net/netfilter/ipvs/ip_vs_sched.c +++ b/net/netfilter/ipvs/ip_vs_sched.c @@ -104,8 +104,7 @@ static struct ip_vs_scheduler *ip_vs_sched_getbyname(const char *sched_name) mutex_unlock(&ip_vs_sched_mutex); return sched; } - if (sched->module) - module_put(sched->module); + module_put(sched->module); } mutex_unlock(&ip_vs_sched_mutex); |