提交 85b60680 编写于 作者: P Pavel Emelyanov 提交者: 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: NPavel Emelyanov <xemul@openvz.org>
Acked-by: NSimon Horman <horms@verge.net.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 52427c9d
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册