virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio: Don't access device data after unregistration.
@ 2012-09-03 13:50 sjur.brandeland
  0 siblings, 0 replies; 6+ messages in thread
From: sjur.brandeland @ 2012-09-03 13:50 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Sjur Brændeland, Guzman Lugo, Fernadndo, Michael S. Tsirkin,
	linux-kernel, virtualization, Sjur Brændeland

From: Sjur Brændeland <sjur.brandeland@stericsson.com>

Fix panic in virtio.c when CONFIG_DEBUG_SLAB is set.
Use device_del() and put_device() instead of
device_unregister(), and access device data before
calling put_device().


Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
cc: Guzman Lugo, Fernadndo <fernando.lugo@ti.com>
cc: Michael S. Tsirkin <mst@redhat.com>
cc: virtualization@lists.linux-foundation.org
cc: Ohad Ben-Cohen <ohad@wizery.com>
---
 drivers/virtio/virtio.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index c3b3f7f..71eacd1 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -225,8 +225,9 @@ EXPORT_SYMBOL_GPL(register_virtio_device);
 
 void unregister_virtio_device(struct virtio_device *dev)
 {
-	device_unregister(&dev->dev);
+	device_del(&dev->dev);
 	ida_simple_remove(&virtio_index_ida, dev->index);
+	put_device(&dev->dev);
 }
 EXPORT_SYMBOL_GPL(unregister_virtio_device);
 
-- 
1.7.5.4

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-04 14:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1346680242-5717-1-git-send-email-sjur.brandeland@stericsson.com>
2012-09-03 14:14 ` [PATCH] virtio: Don't access device data after unregistration Michael S. Tsirkin
2012-09-03 14:50   ` Sjur Brændeland
2012-09-03 20:18     ` Michael S. Tsirkin
2012-09-04 12:12       ` Sjur Brændeland
     [not found]       ` <CAJK669ZVHOZVEw+1UeLU5KyxZexGfWC0VPnrK5XZd9x935PznQ@mail.gmail.com>
2012-09-04 14:13         ` Michael S. Tsirkin
2012-09-03 13:50 sjur.brandeland

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).