diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-05-05 16:15:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 16:36:37 -0700 |
commit | 51a141104a37369be2822f423ed4444aa34d26a2 (patch) | |
tree | 9d12c22d4fc231f55d4b69b660586140bbd3b714 /fs | |
parent | a0b8d32020681535700e7bd4dac29ecf25d944ae (diff) | |
download | linux-51a141104a37369be2822f423ed4444aa34d26a2.tar.gz linux-51a141104a37369be2822f423ed4444aa34d26a2.tar.bz2 linux-51a141104a37369be2822f423ed4444aa34d26a2.zip |
[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')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 10 |
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) goto out_put; err = read_inode(root_inode); - if(err) - goto out_put; + if(err){ + /* No iput in this case because the dput does that for us */ + dput(sb->s_root); + sb->s_root = NULL; + goto out_free; + } return(0); out_put: - iput(root_inode); + iput(root_inode); out_free: kfree(name); out: |