Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31f4888f authored by Dwight Engen's avatar Dwight Engen Committed by David S. Miller
Browse files

sunvdc: fix module unload/reload



Free resources allocated during port/disk probing so that the module may be
successfully reloaded after unloading.

Signed-off-by: default avatarDwight Engen <dwight.engen@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 92f268ee
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -896,8 +896,19 @@ static int vdc_port_remove(struct vio_dev *vdev)
	struct vdc_port *port = dev_get_drvdata(&vdev->dev);

	if (port) {
		unsigned long flags;

		spin_lock_irqsave(&port->vio.lock, flags);
		blk_stop_queue(port->disk->queue);
		spin_unlock_irqrestore(&port->vio.lock, flags);

		del_timer_sync(&port->vio.timer);

		del_gendisk(port->disk);
		blk_cleanup_queue(port->disk->queue);
		put_disk(port->disk);
		port->disk = NULL;

		vdc_free_tx_ring(port);
		vio_ldc_free(&port->vio);