Skip to content

Commit

Permalink
md: check return code of read_sb_page
Browse files Browse the repository at this point in the history
Function read_sb_page may return ERR_PTR(...). Check for it.

Signed-off-by: Vasiliy Kulikov <[email protected]>
Cc: Neil Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
segoon authored and neilbrown committed Oct 7, 2010
1 parent db8d9d3 commit 5c04f55
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5c04f55

Please sign in to comment.