Skip to content

Commit

Permalink
[PATCH] knfsd: Tidy up unix_domain_find
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Mar 27, 2006
1 parent 74cae61 commit ad1b522
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions net/sunrpc/svcauth_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ad1b522

Please sign in to comment.