diff options
Diffstat (limited to 'fs/ramfs/inode.c')
-rw-r--r-- | fs/ramfs/inode.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index aec766abe3af..b6612d2ed718 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c | |||
@@ -210,7 +210,6 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent) | |||
210 | { | 210 | { |
211 | struct ramfs_fs_info *fsi; | 211 | struct ramfs_fs_info *fsi; |
212 | struct inode *inode = NULL; | 212 | struct inode *inode = NULL; |
213 | struct dentry *root; | ||
214 | int err; | 213 | int err; |
215 | 214 | ||
216 | save_mount_options(sb, data); | 215 | save_mount_options(sb, data); |
@@ -234,14 +233,8 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent) | |||
234 | sb->s_time_gran = 1; | 233 | sb->s_time_gran = 1; |
235 | 234 | ||
236 | inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0); | 235 | inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0); |
237 | if (!inode) { | 236 | sb->s_root = d_make_root(inode); |
238 | err = -ENOMEM; | 237 | if (!sb->s_root) { |
239 | goto fail; | ||
240 | } | ||
241 | |||
242 | root = d_alloc_root(inode); | ||
243 | sb->s_root = root; | ||
244 | if (!root) { | ||
245 | err = -ENOMEM; | 238 | err = -ENOMEM; |
246 | goto fail; | 239 | goto fail; |
247 | } | 240 | } |
@@ -250,7 +243,6 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent) | |||
250 | fail: | 243 | fail: |
251 | kfree(fsi); | 244 | kfree(fsi); |
252 | sb->s_fs_info = NULL; | 245 | sb->s_fs_info = NULL; |
253 | iput(inode); | ||
254 | return err; | 246 | return err; |
255 | } | 247 | } |
256 | 248 | ||