summaryrefslogtreecommitdiff
path: root/drivers/block/virtio_blk.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-23 19:57:19 +0400
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 13:05:27 +0300
commit38f37b578f7d62a827d6f42e21d55bf428f9af8e (patch)
tree8903656c108162efa3825324295c872d682b769e /drivers/block/virtio_blk.c
parent393c525b5bea6989380c4b57508ec901488079f0 (diff)
downloadlinux-38f37b578f7d62a827d6f42e21d55bf428f9af8e.tar.xz
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);