Skip to content

Commit

Permalink
[PATCH] uml: hostfs failed mount handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed May 5, 2005
1 parent a0b8d32 commit 51a1411
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 51a1411

Please sign in to comment.