From: Venkateswararao Jujjuri (JV) Date: Thu, 13 Jan 2011 23:28:39 +0000 (-0800) Subject: [fs/9p] Plug potential acl leak X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c61fa0d6d9d466356ffa89fa1c1a9a1cd726fab4;p=openwrt%2Fstaging%2Fblogic.git [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 Signed-off-by: Eric Van Hensbergen Reviewed-by: Aneesh Kumar K.V --- 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; }