summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunlei He <heyunlei@huawei.com>2018-07-02 10:40:19 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-07-28 18:26:08 -0700
commit68c43a235e8c8fa69322e8239762242cb3e752cb (patch)
tree8d640228e4b757eb7d1bb6f6052ab8234410b903
parentb1385478187a90d4273c328aa8dcad8d47c350a2 (diff)
downloadlinux-stable-68c43a235e8c8fa69322e8239762242cb3e752cb.tar.gz
linux-stable-68c43a235e8c8fa69322e8239762242cb3e752cb.tar.bz2
linux-stable-68c43a235e8c8fa69322e8239762242cb3e752cb.zip
f2fs: check the right return value of memory alloc function
This patch check the right return value of memory alloc function Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 142b34130749..6f21319d08d3 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2798,7 +2798,7 @@ static int init_free_nid_cache(struct f2fs_sb_info *sbi)
for (i = 0; i < nm_i->nat_blocks; i++) {
nm_i->free_nid_bitmap[i] = f2fs_kvzalloc(sbi,
f2fs_bitmap_size(NAT_ENTRY_PER_BLOCK), GFP_KERNEL);
- if (!nm_i->free_nid_bitmap)
+ if (!nm_i->free_nid_bitmap[i])
return -ENOMEM;
}