Skip to content

Commit

Permalink
f2fs: Fix a return value in case of error in 'f2fs_fill_super'
Browse files Browse the repository at this point in the history
err must be set to -ENOMEM, otherwise we return 0.

Fixes: a912b54 ("f2fs: split bio cache")
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
tititiou36 authored and Jaegeuk Kim committed Jul 4, 2017
1 parent a005774 commit b63def9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/f2fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,8 +1977,10 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)

sbi->write_io[i] = kmalloc(n * sizeof(struct f2fs_bio_info),
GFP_KERNEL);
if (!sbi->write_io[i])
if (!sbi->write_io[i]) {
err = -ENOMEM;
goto free_options;
}

for (j = HOT; j < n; j++) {
init_rwsem(&sbi->write_io[i][j].io_rwsem);
Expand Down

0 comments on commit b63def9

Please sign in to comment.