diff --git a/block/partitions/core.c b/block/partitions/core.c index 8f32f3cd0edebb94bf6a9be98a31b89303b3b218..8bf3cf5230092995fcc1fedbd714b83b2eddc134 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -698,9 +698,11 @@ static bool blk_add_partition(struct gendisk *disk, struct block_device *bdev, part = add_partition(disk, p, from, size, state->parts[p].flags, &state->parts[p].info); - if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) { - printk(KERN_ERR " %s: p%d could not be added: %ld\n", - disk->disk_name, p, -PTR_ERR(part)); + if (IS_ERR(part)) { + if (PTR_ERR(part) != -ENXIO) { + printk(KERN_ERR " %s: p%d could not be added: %ld\n", + disk->disk_name, p, -PTR_ERR(part)); + } return true; }