devpts: unregister the file system on error
authorAlan Cox <alan@linux.intel.com>
Thu, 11 Jun 2009 13:03:55 +0000 (14:03 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Jun 2009 15:51:06 +0000 (08:51 -0700)
Closes-bug: http://bugzilla.kernel.org/show_bug.cgi?id=13429

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/devpts/inode.c

index c68edb9..9b1d285 100644 (file)
@@ -557,8 +557,10 @@ static int __init init_devpts_fs(void)
        int err = register_filesystem(&devpts_fs_type);
        if (!err) {
                devpts_mnt = kern_mount(&devpts_fs_type);
-               if (IS_ERR(devpts_mnt))
+               if (IS_ERR(devpts_mnt)) {
                        err = PTR_ERR(devpts_mnt);
+                       unregister_filesystem(&devpts_fs_type);
+               }
        }
        return err;
 }