summaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipvs/ip_vs_ctl.c
diff options
context:
space:
mode:
authorMarkus Elfring2014-11-18 20:37:05 +0100
committerPablo Neira Ayuso2014-11-20 13:08:43 +0100
commit982f405136a44754e884184d24b70d2d4cefcb7a (patch)
tree859f3fc225ed106392df89500c2deac8de57326d /net/netfilter/ipvs/ip_vs_ctl.c
parentnetfilter: nf_conntrack_h323: lookup route from proper net namespace (diff)
downloadkernel-qcow2-linux-982f405136a44754e884184d24b70d2d4cefcb7a.tar.gz
kernel-qcow2-linux-982f405136a44754e884184d24b70d2d4cefcb7a.tar.xz
kernel-qcow2-linux-982f405136a44754e884184d24b70d2d4cefcb7a.zip
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_ctl.c')
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index ac7ba689efe7..b8295a430a56 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -465,8 +465,7 @@ __ip_vs_bind_svc(struct ip_vs_dest *dest, struct ip_vs_service *svc)
static void ip_vs_service_free(struct ip_vs_service *svc)
{
- if (svc->stats.cpustats)
- free_percpu(svc->stats.cpustats);
+ free_percpu(svc->stats.cpustats);
kfree(svc);
}