f2fs: Fix a return value in case of error in 'f2fs_fill_super'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 11 Jun 2017 07:21:11 +0000 (09:21 +0200)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Jul 2017 09:11:40 +0000 (02:11 -0700)
err must be set to -ENOMEM, otherwise we return 0.

Fixes: a912b54d3aaa0 ("f2fs: split bio cache")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index ddd2973ffcbf0bccfac33449721ad63f54de372d..fe86a7edfa60dbcc697475be1a93b0e5ac9baffb 100644 (file)
@@ -1977,8 +1977,10 @@ try_onemore:
 
                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);