diff mbox

[1/2] ocfs2: dereferencing freed pointers in ocfs2_reflink()

Message ID 20150305174619.GA13294@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter March 5, 2015, 5:46 p.m. UTC
The code at the "out" label assumes that "default_acl" and "acl" are
NULL, but actually the pointers can be NULL, unitialized, or freed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Mark Fasheh March 9, 2015, 3:02 p.m. UTC | #1
On Thu, Mar 05, 2015 at 08:46:19PM +0300, Dan Carpenter wrote:
> The code at the "out" label assumes that "default_acl" and "acl" are
> NULL, but actually the pointers can be NULL, unitialized, or freed.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Mark Fasheh <mfasheh@suse.de>

--
Mark Fasheh
diff mbox

Patch

diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index ee541f9..df3a500 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -4276,7 +4276,7 @@  static int ocfs2_reflink(struct dentry *old_dentry, struct inode *dir,
 	error = posix_acl_create(dir, &mode, &default_acl, &acl);
 	if (error) {
 		mlog_errno(error);
-		goto out;
+		return error;
 	}
 
 	error = ocfs2_create_inode_in_orphan(dir, mode,