summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/acl.c
diff options
context:
space:
mode:
authorJoseph Qi <joseph.qi@huawei.com>2013-09-11 14:19:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 15:56:39 -0700
commit3d94ea51c1d8db6f41268a9d2aea5f5771e9a8d3 (patch)
tree28907cc30d1d8502c0af318aba031fce1a7cc9aa /fs/ocfs2/acl.c
parentdf53cd3b70712cd136f10ef79457623c5c3764a4 (diff)
downloadlinux-3d94ea51c1d8db6f41268a9d2aea5f5771e9a8d3.tar.gz
linux-3d94ea51c1d8db6f41268a9d2aea5f5771e9a8d3.tar.bz2
linux-3d94ea51c1d8db6f41268a9d2aea5f5771e9a8d3.zip
ocfs2: clean up dead code in ocfs2_acl_from_xattr()
In ocfs2_acl_from_xattr(), if size is less than sizeof(struct posix_acl_entry), it returns ERR_PTR(-EINVAL) directly. Then assign (size / sizeof(struct posix_acl_entry)) to count which will be at least 1, that means the following branch (count < 0) and (count == 0) will never be true. Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Acked-by: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/acl.c')
-rw-r--r--fs/ocfs2/acl.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 8a404576fb26..b4f788e0ca31 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -51,10 +51,6 @@ static struct posix_acl *ocfs2_acl_from_xattr(const void *value, size_t size)
return ERR_PTR(-EINVAL);
count = size / sizeof(struct posix_acl_entry);
- if (count < 0)
- return ERR_PTR(-EINVAL);
- if (count == 0)
- return NULL;
acl = posix_acl_alloc(count, GFP_NOFS);
if (!acl)