lkml.org 
[lkml]   [2006]   [Mar]   [24]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromNeilBrown <>
DateFri, 24 Mar 2006 16:53:52 +1100
Subject[PATCH 001 of 2] knfsd: Tidy up unix_domain_find
We shouldn't really compare &new->h with anything when new ==NULL,
and gather three different if statements that all start
  if (rv ...
into one large if.


Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./net/sunrpc/svcauth_unix.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff ./net/sunrpc/svcauth_unix.c~current~ ./net/sunrpc/svcauth_unix.c
--- ./net/sunrpc/svcauth_unix.c~current~	2006-03-24 12:06:14.000000000 +1100
+++ ./net/sunrpc/svcauth_unix.c	2006-03-24 12:08:04.000000000 +1100
@@ -36,16 +36,16 @@ struct auth_domain *unix_domain_find(cha
 
 	rv = auth_domain_lookup(name, NULL);
 	while(1) {
-		if (rv != &new->h) {
-			if (new) auth_domain_put(&new->h);
+		if (rv) {
+			if (new && rv != &new->h)
+				auth_domain_put(&new->h);
+
+			if (rv->flavour != &svcauth_unix) {
+				auth_domain_put(rv);
+				return NULL;
+			}
 			return rv;
 		}
-		if (rv && rv->flavour != &svcauth_unix) {
-			auth_domain_put(rv);
-			return NULL;
-		}
-		if (rv)
-			return rv;
 
 		new = kmalloc(sizeof(*new), GFP_KERNEL);
 		if (new == NULL)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-03-24 05:58    [from the cache]
©2003-2008