mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[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>
This commit is contained in:
parent
74cae61ab4
commit
ad1b5229de
1 changed files with 8 additions and 8 deletions
|
@ -36,16 +36,16 @@ struct auth_domain *unix_domain_find(char *name)
|
||||||
|
|
||||||
rv = auth_domain_lookup(name, NULL);
|
rv = auth_domain_lookup(name, NULL);
|
||||||
while(1) {
|
while(1) {
|
||||||
if (rv != &new->h) {
|
if (rv) {
|
||||||
if (new) auth_domain_put(&new->h);
|
if (new && rv != &new->h)
|
||||||
return rv;
|
auth_domain_put(&new->h);
|
||||||
}
|
|
||||||
if (rv && rv->flavour != &svcauth_unix) {
|
if (rv->flavour != &svcauth_unix) {
|
||||||
auth_domain_put(rv);
|
auth_domain_put(rv);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (rv)
|
|
||||||
return rv;
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
new = kmalloc(sizeof(*new), GFP_KERNEL);
|
new = kmalloc(sizeof(*new), GFP_KERNEL);
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
|
|
Loading…
Add table
Reference in a new issue