summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-17 23:38:37 -0400
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-08-02 12:34:03 -0400
commit98d8ba69ff1ac168e73ac509228c4701bf6c3b87 (patch)
treeeee2ed68f1cfb686ae43265403357da2e9ac7544 /block
parent8b5d143c95533aa18ac3b39b82568391a7225a61 (diff)
downloadlwn-98d8ba69ff1ac168e73ac509228c4701bf6c3b87.tar.gz
lwn-98d8ba69ff1ac168e73ac509228c4701bf6c3b87.zip
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) <willy@infradead.org>
Diffstat (limited to 'block')
-rw-r--r--block/partitions/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 52871fa224ee..58034dd2d215 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,