diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-11-20 07:52:41 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 23:54:35 +0100 |
commit | 85b606800be20ceeca36bd8594c1eb228d2fb2f4 (patch) | |
tree | 4a9f09e3b12583c7c17858b61b77aa26eccd3547 /net/ipv4/ipvs | |
parent | [TUN]: Use iov_length() (diff) | |
download | linux-85b606800be20ceeca36bd8594c1eb228d2fb2f4.tar.xz linux-85b606800be20ceeca36bd8594c1eb228d2fb2f4.zip |
[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: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_app.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 664cb8e97c1c..535abe0c45e7 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c @@ -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); } |