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(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 1af61e0..24b5262 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;
        }
 
-- 
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
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to