aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hostfs
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2005-05-05 19:15:34 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 19:36:37 -0400
commit51a141104a37369be2822f423ed4444aa34d26a2 (patch)
tree9d12c22d4fc231f55d4b69b660586140bbd3b714 /fs/hostfs
parenta0b8d32020681535700e7bd4dac29ecf25d944ae (diff)
[PATCH] uml: hostfs failed mount handling
This cleans up the error handling and fixes a crash if a hostfs mount fails. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hostfs')
-rw-r--r--fs/hostfs/hostfs_kern.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index e6c63d9cac7b..14a0d339d036 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -991,13 +991,17 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
991 goto out_put; 991 goto out_put;
992 992
993 err = read_inode(root_inode); 993 err = read_inode(root_inode);
994 if(err) 994 if(err){
995 goto out_put; 995 /* No iput in this case because the dput does that for us */
996 dput(sb->s_root);
997 sb->s_root = NULL;
998 goto out_free;
999 }
996 1000
997 return(0); 1001 return(0);
998 1002
999 out_put: 1003 out_put:
1000 iput(root_inode); 1004 iput(root_inode);
1001 out_free: 1005 out_free:
1002 kfree(name); 1006 kfree(name);
1003 out: 1007 out: