Commit ad1b5229def92b71631a927895b034ceec06c991

Authored by NeilBrown
Committed by Linus Torvalds
1 parent 74cae61ab4

[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>

Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff

net/sunrpc/svcauth_unix.c
... ... @@ -36,16 +36,16 @@
36 36  
37 37 rv = auth_domain_lookup(name, NULL);
38 38 while(1) {
39   - if (rv != &new->h) {
40   - if (new) auth_domain_put(&new->h);
  39 + if (rv) {
  40 + if (new && rv != &new->h)
  41 + auth_domain_put(&new->h);
  42 +
  43 + if (rv->flavour != &svcauth_unix) {
  44 + auth_domain_put(rv);
  45 + return NULL;
  46 + }
41 47 return rv;
42 48 }
43   - if (rv && rv->flavour != &svcauth_unix) {
44   - auth_domain_put(rv);
45   - return NULL;
46   - }
47   - if (rv)
48   - return rv;
49 49  
50 50 new = kmalloc(sizeof(*new), GFP_KERNEL);
51 51 if (new == NULL)