Skip to content

Commit

Permalink
Fix crash in virtio_blk during modprobe ; rmmod ; modprobe
Browse files Browse the repository at this point in the history
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 <clalance@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (moved del_gendisk up)
  • Loading branch information
Chris Lalancette authored and Rusty Russell committed May 30, 2008
1 parent e27810f commit ac9d463
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ac9d463

Please sign in to comment.