diff options
author | Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com> | 2015-11-26 15:45:35 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-26 16:47:44 +0100 |
commit | 3e32e8a96e6995cde3d8a13d68e31226ee83f290 (patch) | |
tree | a0fe9222a8f7793016e981cb43f44f16f8dd3796 /hw/scsi | |
parent | 12a3567c4099be194b44987ac5d7d65b99bcfab7 (diff) | |
download | hqemu-3e32e8a96e6995cde3d8a13d68e31226ee83f290.zip hqemu-3e32e8a96e6995cde3d8a13d68e31226ee83f290.tar.gz |
virtio-scsi: don't crash without a valid device
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" <jno@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Message-Id: <1448549135-6582-2-git-send-email-jno@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi')
-rw-r--r-- | hw/scsi/virtio-scsi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 7655401..3a4f520 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -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". */ |