Commit 768fa557 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3: Fix leak in ext3_acl_chmod()

From: Andreas Gruenbacher <agruen@suse.de>

This function can leak a posix_acl on an error path.
parent fa60a3cf
...@@ -416,12 +416,14 @@ ext3_acl_chmod(struct inode *inode) ...@@ -416,12 +416,14 @@ ext3_acl_chmod(struct inode *inode)
handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS); handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
error = PTR_ERR(handle);
ext3_std_error(inode->i_sb, error); ext3_std_error(inode->i_sb, error);
return PTR_ERR(handle); goto out;
} }
error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone); error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
ext3_journal_stop(handle); ext3_journal_stop(handle);
} }
out:
posix_acl_release(clone); posix_acl_release(clone);
return error; return error;
} }
......
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