aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/virtio/virtio.c2
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);
336out: 338out:
337 if (err) 339 if (err)
338 virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED); 340 virtio_add_status(dev, VIRTIO_CONFIG_S_FAILED);