]> Git Repo - qemu.git/commitdiff
virtio-scsi: don't crash without a valid device
authorEugene (jno) Dvurechenski <[email protected]>
Thu, 26 Nov 2015 14:45:35 +0000 (15:45 +0100)
committerPaolo Bonzini <[email protected]>
Thu, 26 Nov 2015 15:47:44 +0000 (16:47 +0100)
Make sure that we actually have a device when checking the aio
context. Otherwise guests could trigger QEMU crashes.

Signed-off-by: "Eugene (jno) Dvurechenski" <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Message-Id: <1448549135[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/scsi/virtio-scsi.c

index 76554011cbffb4c940514d9d98b09255c81ff51d..3a4f520fbb08a44c4551f0c4e8ba5963ff43e312 100644 (file)
@@ -250,7 +250,7 @@ static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req)
     int target;
     int ret = 0;
 
-    if (s->dataplane_started) {
+    if (s->dataplane_started && d) {
         assert(blk_get_aio_context(d->conf.blk) == s->ctx);
     }
     /* Here VIRTIO_SCSI_S_OK means "FUNCTION COMPLETE".  */
This page took 0.027951 seconds and 4 git commands to generate.