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 04/10] blktap: Fix reference to freed struct request.

To: Xen <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 04/10] blktap: Fix reference to freed struct request.
From: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Date: Tue, 8 Mar 2011 16:42:51 -0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Delivery-date: Tue, 08 Mar 2011 16:47:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1299631377-7853-1-git-send-email-daniel.stodden@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1299631377-7853-1-git-send-email-daniel.stodden@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The request will be freed by the call to __blktap_end_rq(), so rq->q
is invalid before spin_unlock_irq().

Signed-off-by: Dominic Curran <dominic.curran@xxxxxxxxxx>
Acked-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 drivers/block/blktap/device.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/blktap/device.c b/drivers/block/blktap/device.c
index 9a09457..8caff9f 100644
--- a/drivers/block/blktap/device.c
+++ b/drivers/block/blktap/device.c
@@ -135,9 +135,11 @@ __blktap_end_rq(struct request *rq, int err)
 static inline void
 blktap_end_rq(struct request *rq, int err)
 {
-       spin_lock_irq(rq->q->queue_lock);
+       struct request_queue *q = rq->q;
+
+       spin_lock_irq(q->queue_lock);
        __blktap_end_rq(rq, err);
-       spin_unlock_irq(rq->q->queue_lock);
+       spin_unlock_irq(q->queue_lock);
 }
 
 void
-- 
1.7.0.4


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

<Prev in Thread] Current Thread [Next in Thread>