From: Yunlei He Date: Mon, 2 Jul 2018 02:40:19 +0000 (+0800) Subject: f2fs: check the right return value of memory alloc function X-Git-Tag: rel_imx_4.19.35_1.1.0~9425^2~58 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=68c43a235e8c8fa69322e8239762242cb3e752cb;p=linux.git 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 Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- 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; }