Commit beaf226b authored by Miklos Szeredi's avatar Miklos Szeredi

posix_acl: don't ignore return value of posix_acl_create_masq()

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Cc: Andreas Gruenbacher <agruenba@redhat.com>
parent 280db3c8
...@@ -598,13 +598,14 @@ posix_acl_create(struct inode *dir, umode_t *mode, ...@@ -598,13 +598,14 @@ posix_acl_create(struct inode *dir, umode_t *mode,
if (IS_ERR(p)) if (IS_ERR(p))
return PTR_ERR(p); return PTR_ERR(p);
ret = -ENOMEM;
clone = posix_acl_clone(p, GFP_NOFS); clone = posix_acl_clone(p, GFP_NOFS);
if (!clone) if (!clone)
goto no_mem; goto err_release;
ret = posix_acl_create_masq(clone, mode); ret = posix_acl_create_masq(clone, mode);
if (ret < 0) if (ret < 0)
goto no_mem_clone; goto err_release_clone;
if (ret == 0) if (ret == 0)
posix_acl_release(clone); posix_acl_release(clone);
...@@ -618,11 +619,11 @@ posix_acl_create(struct inode *dir, umode_t *mode, ...@@ -618,11 +619,11 @@ posix_acl_create(struct inode *dir, umode_t *mode,
return 0; return 0;
no_mem_clone: err_release_clone:
posix_acl_release(clone); posix_acl_release(clone);
no_mem: err_release:
posix_acl_release(p); posix_acl_release(p);
return -ENOMEM; return ret;
} }
EXPORT_SYMBOL_GPL(posix_acl_create); EXPORT_SYMBOL_GPL(posix_acl_create);
......
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