diff options
Diffstat (limited to 'fs/hostfs/hostfs_kern.c')
-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) | |||
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: |