diff options
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/check.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 6fb4b6150d77..0b6113ba3b79 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -177,7 +177,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev) | |||
177 | else if (warn_no_part) | 177 | else if (warn_no_part) |
178 | printk(" unable to read partition table\n"); | 178 | printk(" unable to read partition table\n"); |
179 | kfree(state); | 179 | kfree(state); |
180 | return NULL; | 180 | return ERR_PTR(res); |
181 | } | 181 | } |
182 | 182 | ||
183 | /* | 183 | /* |
@@ -494,6 +494,8 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) | |||
494 | disk->fops->revalidate_disk(disk); | 494 | disk->fops->revalidate_disk(disk); |
495 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) | 495 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) |
496 | return 0; | 496 | return 0; |
497 | if (IS_ERR(state)) /* I/O error reading the partition table */ | ||
498 | return PTR_ERR(state); | ||
497 | for (p = 1; p < state->limit; p++) { | 499 | for (p = 1; p < state->limit; p++) { |
498 | sector_t size = state->parts[p].size; | 500 | sector_t size = state->parts[p].size; |
499 | sector_t from = state->parts[p].from; | 501 | sector_t from = state->parts[p].from; |