f2fs: fix memory leak of write_io in fill_super()
authorChao Yu <yuchao0@huawei.com>
Wed, 5 Sep 2018 06:54:01 +0000 (14:54 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 26 Oct 2018 18:21:43 +0000 (11:21 -0700)
It needs to release memory allocated for sbi->write_io in error path,
otherwise, it will cause memory leak.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index f650e51c106097ac10251b9d6a4f5cfdf76aaa5f..bd8956692e12ac71c6509211ddc6d237e5e998e4 100644 (file)
@@ -2871,7 +2871,7 @@ try_onemore:
                                     GFP_KERNEL);
                if (!sbi->write_io[i]) {
                        err = -ENOMEM;
-                       goto free_options;
+                       goto free_bio_info;
                }
 
                for (j = HOT; j < n; j++) {