Skip to content

Commit

Permalink
Fix potential memory leak in fs/nfsd/nfs4_acl.c
Browse files Browse the repository at this point in the history
Issue was spotted during review process for porting to kernel 6.1.
  • Loading branch information
anodos325 authored May 22, 2023
1 parent d02ac88 commit 5462836
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/nfsd/nfs4acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ get_nfs4_nfsv41xdr_acl(struct svc_rqst *rqstp, struct dentry *dentry,
return -ENOMEM;

len = vfs_getxattr(&init_user_ns, dentry, NA41_NAME, xdr_buf, xdr_buf_sz);
if (len == 0)
return -EOPNOTSUPP;
if (len == 0) {
error = -EOPNOTSUPP;
goto out;
}

if (len < 0) {
switch (len) {
Expand Down

0 comments on commit 5462836

Please sign in to comment.