[PATCH] reiserfs: fix potential (unlikely) oops in reiserfs_get_acl
authorJeff Mahoney <jeffm@suse.com>
Mon, 13 Feb 2006 16:12:36 +0000 (11:12 -0500)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 13 Feb 2006 16:56:01 +0000 (08:56 -0800)
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>
fs/reiserfs/xattr_acl.c

index 43de3ba..ab8894c 100644 (file)
@@ -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);