Commit 51a14110 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: hostfs failed mount handling

This cleans up the error handling and fixes a crash if a hostfs mount fails.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a0b8d320
...@@ -991,13 +991,17 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) ...@@ -991,13 +991,17 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent)
goto out_put; goto out_put;
err = read_inode(root_inode); err = read_inode(root_inode);
if(err) if(err){
goto out_put; /* 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); return(0);
out_put: out_put:
iput(root_inode); iput(root_inode);
out_free: out_free:
kfree(name); kfree(name);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment