[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] blktap: fix reference to freed struct request.



blktap: fix reference to freed struct request.

The request will be freed by the call to __blktap_end_rq(), so to
rq->q is invalid before spin_unlock_irq().

Signed-off-by: Dominic Curran <dominic.curran@
Acked-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>

diff -r d971c4c2e309 drivers/xen/blktap2/device.c
--- a/drivers/xen/blktap2/device.c    Tue Mar 08 10:02:58 2011 -0800
+++ b/drivers/xen/blktap2/device.c    Tue Mar 08 10:04:28 2011 -0800
@@ -135,9 +135,11 @@
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

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.