[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>
This commit is contained in:
committed by
Linus Torvalds
parent
a0b8d32020
commit
51a141104a
@@ -991,8 +991,12 @@ 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);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user