stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "virtio: release virtio index when fail to device_register" has been added to the 3.18-stable tree
@ 2017-12-11 22:17 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-12-11 22:17 UTC (permalink / raw)
  To: zwp10758, cohuck, gregkh, mst, zhangweiping; +Cc: stable, stable-commits


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 3.18-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-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From e60ea67bb60459b95a50a156296041a13e0e380e Mon Sep 17 00:00:00 2001
From: weiping zhang <zwp10758@gmail.com>
Date: Wed, 29 Nov 2017 09:23:01 +0800
Subject: virtio: release virtio index when fail to device_register

From: weiping zhang <zwp10758@gmail.com>

commit e60ea67bb60459b95a50a156296041a13e0e380e upstream.

index can be reused by other virtio device.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/virtio/virtio.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -268,6 +268,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 zwp10758@gmail.com are

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-11 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-11 22:17 Patch "virtio: release virtio index when fail to device_register" has been added to the 3.18-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).