From: Chris Lalancette Date: Fri, 30 May 2008 20:09:41 +0000 (-0500) Subject: Fix crash in virtio_blk during modprobe ; rmmod ; modprobe X-Git-Tag: v2.6.26-rc5~30^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac9d463afb1ca2434335351f3b7d9e4c8f8470e9;p=linux-2.6 Fix crash in virtio_blk during modprobe ; rmmod ; modprobe Fix a modprobe virtio_blk ; rmmod virtio_blk ; modprobe virtio_blk crash; this was basically because we weren't doing "del_gendisk()" in the remove path. Signed-off-by: Chris Lalancette Signed-off-by: Rusty Russell (moved del_gendisk up) --- diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 84e064ffee..c4804f3465 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -311,6 +311,7 @@ static void virtblk_remove(struct virtio_device *vdev) /* Stop all the virtqueues. */ vdev->config->reset(vdev); + del_gendisk(vblk->disk); blk_cleanup_queue(vblk->disk->queue); put_disk(vblk->disk); mempool_destroy(vblk->pool);