From: Matthew Wilcox (Oracle) Date: Wed, 18 May 2022 03:38:37 +0000 (-0400) Subject: block: Handle partition read errors more consistently X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=98d8ba69ff1ac168e73ac509228c4701bf6c3b87;p=linux.git 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: Matthew Wilcox (Oracle) --- diff --git a/block/partitions/core.c b/block/partitions/core.c index 52871fa224eeb..58034dd2d2155 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -709,7 +709,7 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p) if (n >= get_capacity(state->disk)) { state->access_beyond_eod = true; - return NULL; + goto out; } page = read_mapping_page(mapping,