f2fs: check the right return value of memory alloc function
PATCH 1/1 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 <[email protected]>
--- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.c +1 -1
@@ -2794,7 +2794,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,NAT_ENTRY_BITMAP_SIZE_ALIGNED ,GFP_KERNEL ); -if (!nm_i->free_nid_bitmap) +if (!nm_i->free_nid_bitmap[i])return -ENOMEM ; }
Signature · 6 lines
1.9.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 2 lines · Yunlei He
This patch check the right return value of memory alloc function
Quoted 1 line
Signed-off-by Yunlei He <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot