Revert "UBUNTU: SAUCE: apparmor: fix reference count leak when securityfs_setup_d_inode() fails"

BugLink: http://bugs.launchpad.net/bugs/1669611

This reverts commit 06393b1b.
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Acked-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 042e2576
......@@ -1052,12 +1052,12 @@ static int ns_mkdir_op(struct inode *dir, struct dentry *dentry, umode_t mode)
error = securityfs_pin_fs();
inode_lock_nested(dir, I_MUTEX_PARENT);
if (error)
goto out;
return error;
error = __securityfs_setup_d_inode(dir, dentry, mode | S_IFDIR, NULL,
NULL, NULL);
if (error)
goto out;
return error;
ns = aa_create_ns(parent, ACCESS_ONCE(dentry->d_name.name), dentry);
if (IS_ERR(ns)) {
......@@ -1066,7 +1066,6 @@ static int ns_mkdir_op(struct inode *dir, struct dentry *dentry, umode_t mode)
}
aa_put_ns(ns); /* list ref remains */
out:
aa_put_ns(parent);
return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment