mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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>
This commit is contained in:
parent
393c525b5b
commit
38f37b578f
1 changed files with 1 additions and 1 deletions
|
@ -884,8 +884,8 @@ static int __init init(void)
|
|||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue