diff --git a/block/partitions/core.c b/block/partitions/core.c index 534e11285a8d4..b45539764c994 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -529,7 +529,7 @@ int bdev_del_partition(struct block_device *bdev, int partno) bdevp = bdget_disk(bdev->bd_disk, partno); if (!bdevp) - return -ENOMEM; + return -ENXIO; mutex_lock(&bdevp->bd_mutex); mutex_lock_nested(&bdev->bd_mutex, 1);