aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/selinuxfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r--security/selinux/selinuxfs.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index d2787cca1fcb..3d2201413028 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1853,7 +1853,6 @@ static struct file_system_type sel_fs_type = {
1853}; 1853};
1854 1854
1855struct vfsmount *selinuxfs_mount; 1855struct vfsmount *selinuxfs_mount;
1856static struct kobject *selinuxfs_kobj;
1857 1856
1858static int __init init_sel_fs(void) 1857static int __init init_sel_fs(void)
1859{ 1858{
@@ -1862,13 +1861,13 @@ static int __init init_sel_fs(void)
1862 if (!selinux_enabled) 1861 if (!selinux_enabled)
1863 return 0; 1862 return 0;
1864 1863
1865 selinuxfs_kobj = kobject_create_and_add("selinux", fs_kobj); 1864 err = sysfs_create_mount_point(fs_kobj, "selinux");
1866 if (!selinuxfs_kobj) 1865 if (err)
1867 return -ENOMEM; 1866 return err;
1868 1867
1869 err = register_filesystem(&sel_fs_type); 1868 err = register_filesystem(&sel_fs_type);
1870 if (err) { 1869 if (err) {
1871 kobject_put(selinuxfs_kobj); 1870 sysfs_remove_mount_point(fs_kobj, "selinux");
1872 return err; 1871 return err;
1873 } 1872 }
1874 1873
@@ -1887,7 +1886,7 @@ __initcall(init_sel_fs);
1887#ifdef CONFIG_SECURITY_SELINUX_DISABLE 1886#ifdef CONFIG_SECURITY_SELINUX_DISABLE
1888void exit_sel_fs(void) 1887void exit_sel_fs(void)
1889{ 1888{
1890 kobject_put(selinuxfs_kobj); 1889 sysfs_remove_mount_point(fs_kobj, "selinux");
1891 kern_unmount(selinuxfs_mount); 1890 kern_unmount(selinuxfs_mount);
1892 unregister_filesystem(&sel_fs_type); 1891 unregister_filesystem(&sel_fs_type);
1893} 1892}