diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 946fdc1734f4..4ae6c221b36d 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1755,7 +1755,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) disk->first_minor = index << part_shift; if (disk->first_minor < index || disk->first_minor > MINORMASK) { err = -EINVAL; - goto out_free_idr; + goto out_err_disk; } disk->minors = 1 << part_shift;