]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
lsi: fix segfault in lsi_command_complete
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 29 Mar 2010 13:42:57 +0000 (15:42 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 18 Apr 2010 20:02:30 +0000 (22:02 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 6ac08101f9de84be1fb7b45f87caed8ba8f3eb5a)

hw/lsi53c895a.c

index 872106d1e7281d2a5dce35a4c9499bac7608b5b4..e0ade1e544d12ff66c40d788dfdaae83f9d44b79 100644 (file)
@@ -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;