diff options
| -rw-r--r-- | drivers/virtio/virtio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 48230a5e12f2..bf7ff3934d7f 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c | |||
| @@ -333,6 +333,8 @@ int register_virtio_device(struct virtio_device *dev) | |||
| 333 | /* device_register() causes the bus infrastructure to look for a | 333 | /* device_register() causes the bus infrastructure to look for a |
| 334 | * matching driver. */ | 334 | * matching driver. */ |
| 335 | err = device_register(&dev->dev); | 335 | err = device_register(&dev->dev); |
| 336 | if (err) | ||
| 337 | ida_simple_remove(&virtio_index_ida, dev->index); | ||
| 336 | out: | 338 | out: |
| 337 | if (err) | 339 | if (err) |
| 338 | virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED); | 340 | virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED); |
