Commit cfa0ebc9 authored by Andrew Jones's avatar Andrew Jones Committed by Michael S. Tsirkin

virtio-net: fix module unloading

Unregister the driver before removing multi-instance hotplug
callbacks. This order avoids the warning issued from
__cpuhp_remove_state_cpuslocked when the number of remaining
instances isn't yet zero.

Fixes: 8017c279 ("net/virtio-net: Convert to hotplug state machine")
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent f9aada5f
...@@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init); ...@@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init);
static __exit void virtio_net_driver_exit(void) static __exit void virtio_net_driver_exit(void)
{ {
unregister_virtio_driver(&virtio_net_driver);
cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD); cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD);
cpuhp_remove_multi_state(virtionet_online); cpuhp_remove_multi_state(virtionet_online);
unregister_virtio_driver(&virtio_net_driver);
} }
module_exit(virtio_net_driver_exit); module_exit(virtio_net_driver_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment