]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/socket.c
fs: scale mntget/mntput
[mirror_ubuntu-bionic-kernel.git] / net / socket.c
index 0ee74c325320700f5b2bde733c6869804d486fd5..815bba3d2fe09c352d6a85f138fae7c4dcd83745 100644 (file)
@@ -2390,6 +2390,8 @@ EXPORT_SYMBOL(sock_unregister);
 
 static int __init sock_init(void)
 {
+       int err;
+
        /*
         *      Initialize sock SLAB cache.
         */
@@ -2406,8 +2408,15 @@ static int __init sock_init(void)
         */
 
        init_inodecache();
-       register_filesystem(&sock_fs_type);
+
+       err = register_filesystem(&sock_fs_type);
+       if (err)
+               goto out_fs;
        sock_mnt = kern_mount(&sock_fs_type);
+       if (IS_ERR(sock_mnt)) {
+               err = PTR_ERR(sock_mnt);
+               goto out_mount;
+       }
 
        /* The real protocol initialization is performed in later initcalls.
         */
@@ -2420,7 +2429,13 @@ static int __init sock_init(void)
        skb_timestamping_init();
 #endif
 
-       return 0;
+out:
+       return err;
+
+out_mount:
+       unregister_filesystem(&sock_fs_type);
+out_fs:
+       goto out;
 }
 
 core_initcall(sock_init);      /* early initcall */