aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r--fs/nfs/nfs3proc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 71bc16225b98..f7174f3a9575 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -195,15 +195,20 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
.access = entry->mask,
};
struct nfs3_accessres res;
+ struct auth_cred acred = {
+ .cred = entry->cred,
+ };
struct rpc_message msg = {
.rpc_proc = &nfs3_procedures[NFS3PROC_ACCESS],
.rpc_argp = &arg,
.rpc_resp = &res,
- .rpc_cred = entry->cred,
+ .rpc_cred = rpc_lookup_generic_cred(&acred, 0, GFP_NOFS),
};
int status = -ENOMEM;
dprintk("NFS call access\n");
+ if (!msg.rpc_cred)
+ goto out;
res.fattr = nfs_alloc_fattr();
if (res.fattr == NULL)
goto out;
@@ -214,6 +219,8 @@ static int nfs3_proc_access(struct inode *inode, struct nfs_access_entry *entry)
nfs_access_set_mask(entry, res.access);
nfs_free_fattr(res.fattr);
out:
+ if (msg.rpc_cred)
+ put_rpccred(msg.rpc_cred);
dprintk("NFS reply access: %d\n", status);
return status;
}