WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 08/16] blkfront: Fix backtrace in del_gendisk

From: Daniel Stodden <daniel.stodden@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 drivers/block/xen-blkfront.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 50b2952..62eba76 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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);
-- 
1.7.1.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel