Skip to contentSkip to conversation

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

PATCH Superseded Hervé Poussineau 1 participant 1 message Jul 3, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 esp: cancel current request only if some request is in flight

Some device may be selected, but it doesn't mean that a request is pending. This fixes a possible crash of Qemu.

---
 hw/esp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/esp.c +1 -1
index 8e95672..aa50800 100644
@@ -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;
Signature · 1 line
1.7.5.4