All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: cleanup dead code in ocfs2_acl_from_xattr()
Date: Tue, 30 Jul 2013 16:58:22 +0800	[thread overview]
Message-ID: <51F7802E.9080609@huawei.com> (raw)

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>
---
 fs/ocfs2/acl.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 8a40457..b4f788e 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)
-- 
1.7.9.7

             reply	other threads:[~2013-07-30  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30  8:58 Joseph Qi [this message]
2013-08-01  7:22 ` [Ocfs2-devel] [PATCH] ocfs2: cleanup dead code in ocfs2_acl_from_xattr() Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F7802E.9080609@huawei.com \
    --to=joseph.qi@huawei.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.