[fs/9p] Plug potential acl leak
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Thu, 13 Jan 2011 23:28:39 +0000 (15:28 -0800)
committerEric Van Hensbergen <ericvh@gmail.com>
Tue, 15 Mar 2011 14:57:33 +0000 (09:57 -0500)
In v9fs_get_acl() if __v9fs_get_acl() gets only one of the
dacl/pacl we are not releasing it.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
fs/9p/acl.c

index 02a2cf6..291ff7b 100644 (file)
@@ -71,11 +71,15 @@ int v9fs_get_acl(struct inode *inode, struct p9_fid *fid)
        if (!IS_ERR(dacl) && !IS_ERR(pacl)) {
                set_cached_acl(inode, ACL_TYPE_DEFAULT, dacl);
                set_cached_acl(inode, ACL_TYPE_ACCESS, pacl);
-               posix_acl_release(dacl);
-               posix_acl_release(pacl);
        } else
                retval = -EIO;
 
+       if (!IS_ERR(dacl))
+               posix_acl_release(dacl);
+
+       if (!IS_ERR(pacl))
+               posix_acl_release(pacl);
+
        return retval;
 }