From: Sjur Brændeland <sjur.brandeland@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx> cc: Guzman Lugo, Fernadndo <fernando.lugo@xxxxxx> cc: Michael S. Tsirkin <mst@xxxxxxxxxx> cc: virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx cc: Ohad Ben-Cohen <ohad@xxxxxxxxxx> --- 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@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization