diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-12-08 23:20:45 -0500 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-04-05 09:09:31 +0300 |
commit | bab86426d3f322a81af5ee21dfa00f9c06b52a48 (patch) | |
tree | d6ae7562ef73fd257644bfc684a76d02a99e29b6 | |
parent | ffd94c5ba547a594827edfb5a183401d847924c0 (diff) | |
download | kernel-mfld-blackbay-bab86426d3f322a81af5ee21dfa00f9c06b52a48.tar.gz kernel-mfld-blackbay-bab86426d3f322a81af5ee21dfa00f9c06b52a48.tar.bz2 kernel-mfld-blackbay-bab86426d3f322a81af5ee21dfa00f9c06b52a48.zip |
procfs: fix a vfsmount longterm reference leak
kern_mount() doesn't pair with plain mntput()...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/proc/root.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c index d6c3b416529..1421d66a695 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -91,20 +91,18 @@ static struct file_system_type proc_fs_type = { void __init proc_root_init(void) { - struct vfsmount *mnt; int err; proc_init_inodecache(); err = register_filesystem(&proc_fs_type); if (err) return; - mnt = kern_mount_data(&proc_fs_type, &init_pid_ns); - if (IS_ERR(mnt)) { + err = pid_ns_prepare_proc(&init_pid_ns); + if (err) { unregister_filesystem(&proc_fs_type); return; } - init_pid_ns.proc_mnt = mnt; proc_symlink("mounts", NULL, "self/mounts"); proc_net_init(); @@ -209,5 +207,5 @@ int pid_ns_prepare_proc(struct pid_namespace *ns) void pid_ns_release_proc(struct pid_namespace *ns) { - mntput(ns->proc_mnt); + kern_unmount(ns->proc_mnt); } |