aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-11-19 11:20:42 -0500
committerRusty Russell <rusty@rustcorp.com.au>2007-11-18 19:20:42 -0500
commit74b2553f1d13e60fb27063204bd5b6908a6f8494 (patch)
treecd35e82d16cf190ccd95362478a598314de639ce /drivers/net/virtio_net.c
parentd1c856e0f1a4c946c6329cff126548ef4288735f (diff)
virtio: fix module/device unloading
The virtio code never hooked through the ->remove callback. Although noone supports device removal at the moment, this code is already needed for module unloading. This of course also revealed bugs in virtio_blk, virtio_net and lguest unloading paths. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index a75be57fb209..d74e6f4aa248 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -404,8 +404,12 @@ free:
404 404
405static void virtnet_remove(struct virtio_device *vdev) 405static void virtnet_remove(struct virtio_device *vdev)
406{ 406{
407 unregister_netdev(vdev->priv); 407 struct virtnet_info *vi = vdev->priv;
408 free_netdev(vdev->priv); 408
409 vdev->config->del_vq(vi->svq);
410 vdev->config->del_vq(vi->rvq);
411 unregister_netdev(vi->dev);
412 free_netdev(vi->dev);
409} 413}
410 414
411static struct virtio_device_id id_table[] = { 415static struct virtio_device_id id_table[] = {