Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
[powerpc.git] / fs / 9p / vfs_super.c
index d05318f..61c599b 100644 (file)
@@ -8,9 +8,8 @@
  *  Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
  *
  *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -128,12 +127,13 @@ static struct super_block *v9fs_get_sb(struct file_system_type
 
        if ((newfid = v9fs_session_init(v9ses, dev_name, data)) < 0) {
                dprintk(DEBUG_ERROR, "problem initiating session\n");
-               kfree(v9ses);
-               return ERR_PTR(newfid);
+               sb = ERR_PTR(newfid);
+               goto out_free_session;
        }
 
        sb = sget(fs_type, NULL, v9fs_set_super, v9ses);
-
+       if (IS_ERR(sb))
+               goto out_close_session;
        v9fs_fill_super(sb, v9ses, flags);
 
        inode = v9fs_get_inode(sb, S_IFDIR | mode);
@@ -186,6 +186,12 @@ static struct super_block *v9fs_get_sb(struct file_system_type
 
        return sb;
 
+out_close_session:
+       v9fs_session_close(v9ses);
+out_free_session:
+       kfree(v9ses);
+       return sb;
+
 put_back_sb:
        /* deactivate_super calls v9fs_kill_super which will frees the rest */
        up_write(&sb->s_umount);
@@ -262,7 +268,7 @@ static struct super_operations v9fs_super_ops = {
 };
 
 struct file_system_type v9fs_fs_type = {
-       .name = "9P",
+       .name = "9p",
        .get_sb = v9fs_get_sb,
        .kill_sb = v9fs_kill_super,
        .owner = THIS_MODULE,