Revert "block: fix potential invalid pointer dereference in blk_add_partition"

This reverts commit f081315218.
This commit is contained in:
Ksawlii 2024-11-24 00:23:28 +01:00
parent 47123ae968
commit b18c91a11b

View file

@ -691,11 +691,9 @@ 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)) {
if (PTR_ERR(part) != -ENXIO) {
printk(KERN_ERR " %s: p%d could not be added: %pe\n",
disk->disk_name, p, part);
}
if (IS_ERR(part) && PTR_ERR(part) != -ENXIO) {
printk(KERN_ERR " %s: p%d could not be added: %pe\n",
disk->disk_name, p, part);
return true;
}