qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error
@ 2010-04-07 11:47 Jan Kiszka
  2010-04-07 11:57 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2010-04-07 11:47 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Luiz Capitulino

virtio_blk_req_complete releases the request we dereference again for
bdrv_mon_event. Reorder both calls to fix this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 9915840..d5e8c79 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -76,8 +76,8 @@ static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
         bdrv_mon_event(req->dev->bs, BDRV_ACTION_STOP, is_read);
         vm_stop(0);
     } else {
-        virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
         bdrv_mon_event(req->dev->bs, BDRV_ACTION_REPORT, is_read);
+        virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
     }
 
     return 1;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-07 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 11:47 [Qemu-devel] [PATCH] virtio-blk: Fix use after release in virtio_blk_handle_rw_error Jan Kiszka
2010-04-07 11:57 ` Christoph Hellwig
2010-04-07 12:18   ` Kevin Wolf
2010-04-07 12:32     ` Luiz Capitulino
2010-04-07 12:33       ` Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).