Skip to content

Commit

Permalink
blkfront: Fix backtrace in del_gendisk
Browse files Browse the repository at this point in the history
The call to del_gendisk follows an non-refcounted gd->queue
pointer. We release the last ref in blk_cleanup_queue. Fixed by
reordering releases accordingly.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Daniel Stodden authored and Jens Axboe committed Aug 7, 2010
1 parent 5b61cb9 commit 89de166
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,14 +1021,14 @@ static void blkfront_closing(struct blkfront_info *info)
/* Flush gnttab callback work. Must be done with no locks held. */
flush_scheduled_work();

blk_cleanup_queue(info->rq);
info->rq = NULL;

minor = info->gd->first_minor;
nr_minors = info->gd->minors;
del_gendisk(info->gd);
xlbd_release_minors(minor, nr_minors);

blk_cleanup_queue(info->rq);
info->rq = NULL;

out:
if (info->xbdev)
xenbus_frontend_closed(info->xbdev);
Expand Down

0 comments on commit 89de166

Please sign in to comment.