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

Liuwenyi qingshenlwy at gmail.com
Mon Dec 21 06:59:27 EST 2009


move the ACL validation check in to fs/posix_acl.c.
Including nullpointer check and PTR_ERR check.

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

---
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;
}

-- 
Best Regards,
Liuwenyi




More information about the linux-mtd mailing list