Skip to content

Commit

Permalink
ipvs: Delete an unnecessary check before the function call "module_put"
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Markus Elfring authored and Pablo Neira Ayuso committed Jul 15, 2015
1 parent aad0d51 commit 0d6ef06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/ipvs/ip_vs_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0d6ef06

Please sign in to comment.