diff mbox

[V9fs-developer,1/5,fs/9p] Plug potential acl leak

Message ID 1296004338-25228-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Changes Requested, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

jvrao Jan. 26, 2011, 1:12 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/acl.c b/fs/9p/acl.c
index 02a2cf6..291ff7b 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;
 }