From patchwork Mon Dec 21 11:59:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCHv2,08/12] posix_acl: Add the check items Date: Mon, 21 Dec 2009 01:59:27 -0000 From: Liuwenyi X-Patchwork-Id: 41548 Message-Id: <4B2F631F.4070303@gmail.com> To: dwmw2@infradead.org, viro@zeniv.linux.org.uk, jmorris@namei.org, akpm@linux-foundation.org, joel.becker@oracle.com, serue@us.ibm.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, onlyflyer@gmail.com, strongzgy@gmail.com move the ACL validation check in to fs/posix_acl.c. Including nullpointer check and PTR_ERR check. --- Signed-off-by: Liuwenyi Cc: David Woodhouse Cc: Al Viro Cc: James Morris Cc: Andrew Morton Cc: Joel Becker Cc: Serge Hallyn Cc: linux-mtd@lists.infradead.org Cc: linux-kernel@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;