diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-01-13 15:28:39 -0800 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-02-25 13:43:30 -0600 |
commit | 18275d9b686173c72ac57494558124aa406a22e4 (patch) | |
tree | a60a20219ec52ef373b49ca2fec29b6aae47d8c9 /fs/9p | |
parent | 4662db446190ddef8fbab024f72dee77dd04b8f2 (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')
-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) 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; } |