提交 ad1b5229 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[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: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 74cae61a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册