]> err.no Git - linux-2.6/commitdiff
[IPVS]: Relax the module get/put in ip_vs_app.c
authorPavel Emelyanov <xemul@openvz.org>
Tue, 20 Nov 2007 06:52:41 +0000 (22:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:54:35 +0000 (14:54 -0800)
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>
net/ipv4/ipvs/ip_vs_app.c

index 664cb8e97c1c515202d8bd6f05cca73bd9e789b1..535abe0c45e7f4fc4e71c401f249e58bdf9d90eb 100644 (file)
@@ -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);
 }