Commit 85b60680 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[IPVS]: Relax the module get/put in ip_vs_app.c

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: default avatarPavel Emelyanov <xemul@openvz.org>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52427c9d
...@@ -51,17 +51,12 @@ static DEFINE_MUTEX(__ip_vs_app_mutex); ...@@ -51,17 +51,12 @@ static DEFINE_MUTEX(__ip_vs_app_mutex);
*/ */
static inline int ip_vs_app_get(struct ip_vs_app *app) 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); return try_module_get(app->module);
else
return 1;
} }
static inline void ip_vs_app_put(struct ip_vs_app *app) static inline void ip_vs_app_put(struct ip_vs_app *app)
{ {
if (app->module)
module_put(app->module); module_put(app->module);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment