ext4: check bh in ext4_read_block_bitmap()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / ext4 / balloc.c
index cf1821784a16bff41349319400940c7e4218fa5a..33938c120c854ae05b7457d171ede22ce6dfcbe7 100644 (file)
@@ -358,7 +358,7 @@ void ext4_validate_block_bitmap(struct super_block *sb,
 }
 
 /**
- * ext4_read_block_bitmap()
+ * ext4_read_block_bitmap_nowait()
  * @sb:                        super block
  * @block_group:       given block group
  *
@@ -457,6 +457,8 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
        struct buffer_head *bh;
 
        bh = ext4_read_block_bitmap_nowait(sb, block_group);
+       if (!bh)
+               return NULL;
        if (ext4_wait_block_bitmap(sb, block_group, bh)) {
                put_bh(bh);
                return NULL;