block: Remove check of PageError
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 12:51:06 +0000 (08:51 -0400)
If read_mapping_page() sees a page with PageError set, it returns a
PTR_ERR().  Checking PageError again is simply dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
block/partitions/core.c

index 8a0ec929023bcd2ded0579194d99a1044bc7cb6d..a9a51bac42df8b91cd133e8a8003144f4a5e1346 100644 (file)
@@ -716,14 +716,10 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p)
                        (pgoff_t)(n >> (PAGE_SHIFT - 9)), NULL);
        if (IS_ERR(page))
                goto out;
-       if (PageError(page))
-               goto out_put_page;
 
        p->v = page;
        return (unsigned char *)page_address(page) +
                        ((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << SECTOR_SHIFT);
-out_put_page:
-       put_page(page);
 out:
        p->v = NULL;
        return NULL;