sunvdc: fix module unload/reload
PATCH 1/1 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 Dwight Engen <[email protected]>
--- drivers/block/sunvdc.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/block/sunvdc.c +11 -0
@@ -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);
Signature · 1 line
1.7.1
David Miller
AppliedFrom: Dwight Engen <[email protected]>
Date: Thu, 11 Dec 2014 12:25:42 -0500
Quoted 4 lines
Free resources allocated during port/disk probing so that the module may be successfully reloaded after unloading.
Signed-off-by Dwight Engen <[email protected]>
Applied.