Patchwork esp: cancel current request only if some request is in flight

login
register
mail settings
Submitter Hervé Poussineau
Date July 3, 2011, 4:09 p.m.
Message ID <1309709374-9274-1-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/103027/
State New
Headers show

Comments

Hervé Poussineau - July 3, 2011, 4:09 p.m.
Some device may be selected, but it doesn't mean that a request is pending.
This fixes a possible crash of Qemu.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/esp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/esp.c b/hw/esp.c
index 8e95672..aa50800 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -219,7 +219,7 @@  static uint32_t get_cmd(ESPState *s, uint8_t *buf)
     s->ti_rptr = 0;
     s->ti_wptr = 0;
 
-    if (s->current_dev) {
+    if (s->current_req) {
         /* Started a new command before the old one finished.  Cancel it.  */
         scsi_req_cancel(s->current_req);
         s->async_len = 0;