Patchwork virtio-blk: fix the list operation in virtio_blk_load().

login
register
mail settings
Submitter Yoshiaki Tamura
Date June 21, 2010, 8:50 a.m.
Message ID <1277110201-17778-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp>
Download mbox | patch
Permalink /patch/56294/
State New
Headers show

Comments

Yoshiaki Tamura - June 21, 2010, 8:50 a.m.
Although it is really rare to get in to the while loop, the list
operation in the loop is obviously wrong.

Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
---
 hw/virtio-blk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Kevin Wolf - June 21, 2010, 11:03 a.m.
Am 21.06.2010 10:50, schrieb Yoshiaki Tamura:
> Although it is really rare to get in to the while loop, the list
> operation in the loop is obviously wrong.
> 
> Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 75878eb..0bf929a 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -470,7 +470,7 @@  static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
         VirtIOBlockReq *req = virtio_blk_alloc_request(s);
         qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
         req->next = s->rq;
-        s->rq = req->next;
+        s->rq = req;
     }
 
     return 0;