diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-01-13 18:28:39 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 10:57:33 -0400 |
commit | c61fa0d6d9d466356ffa89fa1c1a9a1cd726fab4 (patch) | |
tree | 4302f71f6c05f04848831adb0bda82afe0a75cd9 /fs/9p/acl.c | |
parent | 521cb40b0c44418a4fd36dc633f575813d59a43d (diff) |
[fs/9p] Plug potential acl leak
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>
Diffstat (limited to 'fs/9p/acl.c')
-rw-r--r-- | fs/9p/acl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 02a2cf616318..291ff7be27f6 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -71,11 +71,15 @@ int v9fs_get_acl(struct inode *inode, struct p9_fid *fid) | |||
71 | if (!IS_ERR(dacl) && !IS_ERR(pacl)) { | 71 | if (!IS_ERR(dacl) && !IS_ERR(pacl)) { |
72 | set_cached_acl(inode, ACL_TYPE_DEFAULT, dacl); | 72 | set_cached_acl(inode, ACL_TYPE_DEFAULT, dacl); |
73 | set_cached_acl(inode, ACL_TYPE_ACCESS, pacl); | 73 | set_cached_acl(inode, ACL_TYPE_ACCESS, pacl); |
74 | posix_acl_release(dacl); | ||
75 | posix_acl_release(pacl); | ||
76 | } else | 74 | } else |
77 | retval = -EIO; | 75 | retval = -EIO; |
78 | 76 | ||
77 | if (!IS_ERR(dacl)) | ||
78 | posix_acl_release(dacl); | ||
79 | |||
80 | if (!IS_ERR(pacl)) | ||
81 | posix_acl_release(pacl); | ||
82 | |||
79 | return retval; | 83 | return retval; |
80 | } | 84 | } |
81 | 85 | ||