upgrade to fedora-2.6.12-1.1398.FC4 + vserver 2.0.rc7
[linux-2.6.git] / fs / ext3 / acl.c
index 0425fc8..c027300 100644 (file)
@@ -199,8 +199,7 @@ ext3_get_acl(struct inode *inode, int type)
                acl = NULL;
        else
                acl = ERR_PTR(retval);
-       if (value)
-               kfree(value);
+       kfree(value);
 
        if (!IS_ERR(acl)) {
                switch(type) {
@@ -261,8 +260,6 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
                        return -EINVAL;
        }
        if (acl) {
-               if (acl->a_count > EXT3_ACL_MAX_ENTRIES)
-                       return -EINVAL;
                value = ext3_acl_to_disk(acl, &size);
                if (IS_ERR(value))
                        return (int)PTR_ERR(value);
@@ -271,8 +268,7 @@ ext3_set_acl(handle_t *handle, struct inode *inode, int type,
        error = ext3_xattr_set_handle(handle, inode, name_index, "",
                                      value, size, 0);
 
-       if (value)
-               kfree(value);
+       kfree(value);
        if (!error) {
                switch(type) {
                        case ACL_TYPE_ACCESS:
@@ -292,6 +288,8 @@ ext3_check_acl(struct inode *inode, int mask)
 {
        struct posix_acl *acl = ext3_get_acl(inode, ACL_TYPE_ACCESS);
 
+       if (IS_ERR(acl))
+               return PTR_ERR(acl);
        if (acl) {
                int error = posix_acl_permission(inode, acl, mask);
                posix_acl_release(acl);