summaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-10-01 14:18:12 -0700
committerNeilBrown <neilb@suse.de>2010-10-07 12:02:50 +1100
commit5c04f5512f8134c75cd36e5b0354e10e330f4e6e (patch)
tree7733d3a123e8be8782d345e6310a6c208bfc6606 /drivers/md/bitmap.c
parentdb8d9d3591f77cc6b66248b2cdfa1c43deee5ec9 (diff)
md: check return code of read_sb_page
Function read_sb_page may return ERR_PTR(...). Check for it. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ed4900ade93..e4fb58db545 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1000,10 +1000,11 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
page = bitmap->sb_page;
offset = sizeof(bitmap_super_t);
if (!file)
- read_sb_page(bitmap->mddev,
- bitmap->mddev->bitmap_info.offset,
- page,
- index, count);
+ page = read_sb_page(
+ bitmap->mddev,
+ bitmap->mddev->bitmap_info.offset,
+ page,
+ index, count);
} else if (file) {
page = read_page(file, index, bitmap, count);
offset = 0;