ocfs2: dereferencing freed pointers in ocfs2_reflink()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Apr 2015 22:43:19 +0000 (15:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Apr 2015 23:48:57 +0000 (16:48 -0700)
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>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/refcounttree.c

index ee541f92dab40308352f22cc5794056d44beb432..df3a500789c7eb7bfde662e9a391c86b99ef2a11 100644 (file)
@@ -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,