mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04: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. To fix, cleanup in reverse order of initialization. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
cbd7f8d682
commit
46652a861b
1 changed files with 1 additions and 1 deletions
|
|
@ -871,8 +871,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue