Patchwork [PATCHv2,08/12] posix_acl: Add the check items

login
register
mail settings
Submitter Liuwenyi
Date Dec. 21, 2009, 11:59 a.m.
Message ID <4B2F631F.4070303@gmail.com>
Download mbox | patch
Permalink /patch/41548/
State New
Headers show

Comments

Liuwenyi - Dec. 21, 2009, 11:59 a.m.
move the ACL validation check in to fs/posix_acl.c.
Including nullpointer check and PTR_ERR check.

---
Signed-off-by: Liuwenyi <qingshenlwy@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: James Morris <jmorris@namei.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joel Becker <joel.becker@oracle.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: linux-mtd@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

---
}

Patch

diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c
index 7cdc319..1eb4726 100644
--- a/fs/jffs2/acl.c
+++ b/fs/jffs2/acl.c
@@ -403,13 +403,10 @@  static int jffs2_acl_setxattr(struct dentry
*dentry, const char *name,

if (value) {
acl = posix_acl_from_xattr(value, size);
- if (IS_ERR(acl))
- return PTR_ERR(acl);
- if (acl) {
- rc = posix_acl_valid(acl);
- if (rc)
- goto out;
- }
+ rc = posix_acl_valid(acl);
+ if (rc)
+ goto out;
+
} else {
acl = NULL;