diff options
author | Michael S. Tsirkin | 2014-10-23 18:57:19 +0300 |
---|---|---|
committer | Michael S. Tsirkin | 2014-12-09 12:05:27 +0200 |
commit | 38f37b578f7d62a827d6f42e21d55bf428f9af8e (patch) | |
tree | 8903656c108162efa3825324295c872d682b769e | |
parent | 393c525b5bea6989380c4b57508ec901488079f0 (diff) |
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.c | 2 |
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); |