]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - fs/ext4/balloc.c
ext4: check bh in ext4_read_block_bitmap()
[linux-2.6.git] / fs / ext4 / balloc.c
index df76291d692b9fcc28dce15a0de3388441a6cfc0..bb74d7f0f353240bcc0634205be658cc07eda65e 100644 (file)
@@ -326,7 +326,7 @@ err_out:
        return 0;
 }
 /**
- * ext4_read_block_bitmap()
+ * ext4_read_block_bitmap_nowait()
  * @sb:                        super block
  * @block_group:       given block group
  *
@@ -422,6 +422,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;