block: Handle partition read errors more consistently

Set p->v to NULL if we try to read beyond the end of the disk, just like
we do if we get an error returned from trying to read the disk.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 8b5d143c
...@@ -709,7 +709,7 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p) ...@@ -709,7 +709,7 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p)
if (n >= get_capacity(state->disk)) { if (n >= get_capacity(state->disk)) {
state->access_beyond_eod = true; state->access_beyond_eod = true;
return NULL; goto out;
} }
page = read_mapping_page(mapping, page = read_mapping_page(mapping,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment