Skip to contentSkip to conversation

lsi: fix segfault in lsi_command_complete

PATCH Applied Gerd Hoffmann 2 participants 2 messages Mar 29, 2010 – Apr 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lsi: fix segfault in lsi_command_complete

---
 hw/lsi53c895a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/lsi53c895a.c +1 -1
index a332401..525f3ca 100644
@@ -679,7 +679,7 @@ static void lsi_command_complete(SCSIBus *bus, int reason, uint32_t tag,
         return;
     }
 
-    if (s->waiting == 1 || tag != s->current->tag ||
+    if (s->waiting == 1 || !s->current || tag != s->current->tag ||
         (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {
         if (lsi_queue_tag(s, tag, arg))
             return;
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 2 lines · Gerd Hoffmann

Thanks, applied.

Quoted 23 lines
---
 hw/lsi53c895a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/lsi53c895a.c +1 -1
index a332401..525f3ca 100644
@@ -679,7 +679,7 @@ static void lsi_command_complete(SCSIBus *bus, int reason, uint32_t tag,
         return;
     }
 
-    if (s->waiting == 1 || tag != s->current->tag ||
+    if (s->waiting == 1 || !s->current || tag != s->current->tag ||
         (lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON))) {
         if (lsi_queue_tag(s, tag, arg))
             return;
Signature · 1 line
1.6.6.1
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net