Skip to contentSkip to conversation

Patch "virtio: release virtio index when fail to device_register" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Dec 11, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

virtio: release virtio index when fail to device_register

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
virtio-release-virtio-index-when-fail-to-device_register.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e60ea67bb60459b95a50a156296041a13e0e380e Mon Sep 17 00:00:00 2001

From: weiping zhang <[email protected]>
Date: Wed, 29 Nov 2017 09:23:01 +0800
Subject: virtio: release virtio index when fail to device_register

From: weiping zhang <[email protected]>

commit e60ea67bb60459b95a50a156296041a13e0e380e upstream.

index can be reused by other virtio device.

---
 drivers/virtio/virtio.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/virtio/virtio.c +2 -0
@@ -323,6 +323,8 @@ int register_virtio_device(struct virtio
 	/* device_register() causes the bus infrastructure to look for a
 	 * matching driver. */
 	err = device_register(&dev->dev);
+	if (err)
+		ida_simple_remove(&virtio_index_ida, dev->index);
 out:
 	if (err)
 		add_status(dev, VIRTIO_CONFIG_S_FAILED);

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/virtio-release-virtio-index-when-fail-to-device_register.patch