summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-23 18:57:19 +0300
committerMichael S. Tsirkin <mst@redhat.com>2014-12-09 12:05:27 +0200
commit38f37b578f7d62a827d6f42e21d55bf428f9af8e (patch)
tree8903656c108162efa3825324295c872d682b769e
parent393c525b5bea6989380c4b57508ec901488079f0 (diff)
downloadop-kernel-dev-38f37b578f7d62a827d6f42e21d55bf428f9af8e.zip
op-kernel-dev-38f37b578f7d62a827d6f42e21d55bf428f9af8e.tar.gz
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>
-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 055f3df..1f8b111 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);
OpenPOWER on IntegriCloud