Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3fb4173 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit - the friendly Code Review server
Browse files

ANDROID: fix acl leaks



Fixes regressions associated with commit
073931017b49d9458aa351605b43a7e34598caef

Signed-off-by: default avatarMark Salyzyn <salyzyn@google.com>
Bug: 32458736
Change-Id: I6ee127dfdf3594d24ccd8560541ac554c5b05eb6
[stummala@codeaurora.org: Fixed merge conflicts]
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent b0e45ea7
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -268,16 +268,13 @@ static int gfs2_xattr_system_set(struct dentry *dentry, const char *name,

	if (type == ACL_TYPE_ACCESS) {
		umode_t mode;
		struct posix_acl *old_acl = acl;

		error = posix_acl_update_mode(inode, &mode, &acl);

		if (error <= 0) {
			posix_acl_release(acl);
			acl = NULL;

			if (error < 0)
				return error;
		}
		if (!acl)
			posix_acl_release(old_acl);
		if (error)
			goto out_release;

		error = gfs2_set_mode(inode, mode);
		if (error)
+5 −3
Original line number Diff line number Diff line
@@ -693,11 +693,13 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
			return rc;
		}
		if (acl) {
			rc = posix_acl_equiv_mode(acl, &inode->i_mode);
			posix_acl_release(acl);
			struct posix_acl *old_acl = acl;

			rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
			posix_acl_release(old_acl);
			if (rc < 0) {
				printk(KERN_ERR
				       "posix_acl_equiv_mode returned %d\n",
				       "posix_acl_update_mode returned %d\n",
				       rc);
				return rc;
			}
+5 −8
Original line number Diff line number Diff line
@@ -389,16 +389,13 @@ xfs_xattr_acl_set(struct dentry *dentry, const char *name,

	if (type == ACL_TYPE_ACCESS) {
		umode_t mode;
		struct posix_acl *old_acl = acl;

		error = posix_acl_update_mode(inode, &mode, &acl);

		if (error <= 0) {
			posix_acl_release(acl);
			acl = NULL;

			if (error < 0)
				return error;
		}
		if (!acl)
			posix_acl_release(old_acl);
		if (error)
			goto out_release;

		error = xfs_set_mode(inode, mode);
		if (error)