diff options
Diffstat (limited to 'fs/hostfs')
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index e965eb11d76f..6f10e43746f9 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -966,6 +966,9 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) | |||
966 | goto out_put; | 966 | goto out_put; |
967 | 967 | ||
968 | HOSTFS_I(root_inode)->host_filename = name; | 968 | HOSTFS_I(root_inode)->host_filename = name; |
969 | /* Avoid that in the error path, iput(root_inode) frees again name through | ||
970 | * hostfs_destroy_inode! */ | ||
971 | name = NULL; | ||
969 | 972 | ||
970 | err = -ENOMEM; | 973 | err = -ENOMEM; |
971 | sb->s_root = d_alloc_root(root_inode); | 974 | sb->s_root = d_alloc_root(root_inode); |
@@ -977,7 +980,7 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) | |||
977 | /* No iput in this case because the dput does that for us */ | 980 | /* No iput in this case because the dput does that for us */ |
978 | dput(sb->s_root); | 981 | dput(sb->s_root); |
979 | sb->s_root = NULL; | 982 | sb->s_root = NULL; |
980 | goto out_free; | 983 | goto out; |
981 | } | 984 | } |
982 | 985 | ||
983 | return(0); | 986 | return(0); |