summaryrefslogtreecommitdiffstats
path: root/drivers/block/virtio_blk.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-23 17:57:19 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 11:05:27 +0100
commit38f37b578f7d62a827d6f42e21d55bf428f9af8e (patch)
tree8903656c108162efa3825324295c872d682b769e /drivers/block/virtio_blk.c
parentvirtio_blk: make serial attribute static (diff)
downloadlinux-38f37b578f7d62a827d6f42e21d55bf428f9af8e.tar.xz
linux-38f37b578f7d62a827d6f42e21d55bf428f9af8e.zip
virtio_blk: fix race at module removal
If a device appears while module is being removed, driver will get a callback after we've given up on the major number. In theory this means this major number can get reused by something else, resulting in a conflict. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r--drivers/block/virtio_blk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 055f3df0b4d0..1f8b111c5dab 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -884,8 +884,8 @@ out_destroy_workqueue:
static void __exit fini(void)
{
- unregister_blkdev(major, "virtblk");
unregister_virtio_driver(&virtio_blk);
+ unregister_blkdev(major, "virtblk");
destroy_workqueue(virtblk_wq);
}
module_init(init);