aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-03-27 01:15:11 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 08:44:43 -0800
commitad1b5229def92b71631a927895b034ceec06c991 (patch)
treeb3e1b365a2ce91c72d7f07c6271efc3c6c8ff839 /net/sunrpc
parent[PATCH] fs/nfsd/export.c,net/sunrpc/cache.c: make needlessly global code static (diff)
downloadlinux-dev-ad1b5229def92b71631a927895b034ceec06c991.tar.xz
linux-dev-ad1b5229def92b71631a927895b034ceec06c991.zip
[PATCH] 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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svcauth_unix.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 11020c0b7db5..7e5707e2d6b6 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -36,16 +36,16 @@ struct auth_domain *unix_domain_find(char *name)
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)