Commit e3735c89 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

SUNRPC: remove pointless test in unx_match()

As reported by Dan Carpenter, this test for acred->cred being set is
inconsistent with the dereference of the pointer a few lines earlier.

An 'auth_cred' *always* has ->cred set - every place that creates one
initializes this field, often as the first thing done.

So remove this test.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 45bb8d80
...@@ -87,7 +87,7 @@ unx_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) ...@@ -87,7 +87,7 @@ unx_match(struct auth_cred *acred, struct rpc_cred *cred, int flags)
if (!uid_eq(cred->cr_cred->fsuid, acred->cred->fsuid) || !gid_eq(cred->cr_cred->fsgid, acred->cred->fsgid)) if (!uid_eq(cred->cr_cred->fsuid, acred->cred->fsuid) || !gid_eq(cred->cr_cred->fsgid, acred->cred->fsgid))
return 0; return 0;
if (acred->cred && acred->cred->group_info != NULL) if (acred->cred->group_info != NULL)
groups = acred->cred->group_info->ngroups; groups = acred->cred->group_info->ngroups;
if (groups > UNX_NGROUPS) if (groups > UNX_NGROUPS)
groups = UNX_NGROUPS; groups = UNX_NGROUPS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment