From: Jeff Mahoney <jeffm@suse.com>
Date: Mon, 13 Feb 2006 16:12:36 +0000 (-0500)
Subject: [PATCH] reiserfs: fix potential (unlikely) oops in reiserfs_get_acl
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=90947ef26fa689a3252aa8282a01f60648e70fdb;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git

[PATCH] reiserfs: fix potential (unlikely) oops in reiserfs_get_acl

This fixes a potential oops if there is an error reported by
posix_acl_from_disk().  This is mostly theoretical due to the use of
magics and checksums in xattrs, but is still possible.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---

diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 43de3ba8333..ab8894c3b9e 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -228,7 +228,8 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
 		acl = ERR_PTR(retval);
 	} else {
 		acl = posix_acl_from_disk(value, retval);
-		*p_acl = posix_acl_dup(acl);
+		if (!IS_ERR(acl))
+			*p_acl = posix_acl_dup(acl);
 	}
 
 	kfree(value);