Skip to content

Commit

Permalink
[IPVS]: Relax the module get/put in ip_vs_app.c
Browse files Browse the repository at this point in the history
Both try_module_get/module_put already handle the module == NULL
case, so no need in manual checking.

This patch fits both net-2.6 and net-2.6.25.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 52427c9 commit 85b6068
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net/ipv4/ipvs/ip_vs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,13 @@ static DEFINE_MUTEX(__ip_vs_app_mutex);
*/
static inline int ip_vs_app_get(struct ip_vs_app *app)
{
/* test and get the module atomically */
if (app->module)
return try_module_get(app->module);
else
return 1;
return try_module_get(app->module);
}


static inline void ip_vs_app_put(struct ip_vs_app *app)
{
if (app->module)
module_put(app->module);
module_put(app->module);
}


Expand Down

0 comments on commit 85b6068

Please sign in to comment.