From: Markus Elfring Date: Fri, 10 Jul 2015 06:42:49 +0000 (+0900) Subject: ipvs: Delete an unnecessary check before the function call "module_put" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d6ef0688d8744454646298b85336407be05e309;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ipvs: Delete an unnecessary check before the function call "module_put" 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 Signed-off-by: Simon Horman Signed-off-by: Pablo Neira Ayuso --- 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); }