Skip to content

Commit

Permalink
posix_acl: don't ignore return value of posix_acl_create_masq()
Browse files Browse the repository at this point in the history
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
Miklos Szeredi committed Sep 16, 2016
1 parent 280db3c commit beaf226
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fs/posix_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,14 @@ posix_acl_create(struct inode *dir, umode_t *mode,
if (IS_ERR(p))
return PTR_ERR(p);

ret = -ENOMEM;
clone = posix_acl_clone(p, GFP_NOFS);
if (!clone)
goto no_mem;
goto err_release;

ret = posix_acl_create_masq(clone, mode);
if (ret < 0)
goto no_mem_clone;
goto err_release_clone;

if (ret == 0)
posix_acl_release(clone);
Expand All @@ -618,11 +619,11 @@ posix_acl_create(struct inode *dir, umode_t *mode,

return 0;

no_mem_clone:
err_release_clone:
posix_acl_release(clone);
no_mem:
err_release:
posix_acl_release(p);
return -ENOMEM;
return ret;
}
EXPORT_SYMBOL_GPL(posix_acl_create);

Expand Down

0 comments on commit beaf226

Please sign in to comment.