virtio, acpi: fixes

A couple of bugfixes.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAl3VDhgPHG1zdEByZWRo
 YXQuY29tAAoJECgfDbjSjVRpMbwH/Ai3cA8mBoD0C3Ig28oJuXk5OFLob1MdpQs5
 u+5pMMqYuf9ynUeiH3C9PcDs8nHeOjEB+mLMh38FuJXyCKuATzL23yZ32ofasDfM
 wAg4cv7tOa33uS21a2hFl42GC6bDJnr4nzzK4kBO3PWmbDs7sdLo6YlMWvFPc8x/
 pSr/A04LW9qerPIKWfDl8X5ZP7JlyZfjFJOrt2Qanq/ugUDwULDdrozXrRyfqd/u
 4FYD+Ea9FUoCj0Y1yAl4xvFuv1Ka8FK7Pk2OdEtLVvdCGCX+bcPtgjj+xEE1iGCv
 /hEntk/0fa8H40JDCFLTAKYXm5PgGzIikHfKzGIgbqxQTsaFJ4c=
 =xdTO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, acpi: fixes

A couple of bugfixes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Wed 20 Nov 2019 09:57:44 GMT
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  tests: acpi: always retain dumped ACPI tables in case of error
  vhost-user-input: use free(elem) instead of g_free(elem)
  libvhost-user: Zero memory allocated for VuVirtqInflightDesc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2019-11-20 11:01:20 +00:00
commit bf12043acc
3 changed files with 4 additions and 4 deletions

View File

@ -992,7 +992,7 @@ vu_check_queue_inflights(VuDev *dev, VuVirtq *vq)
vq->shadow_avail_idx = vq->last_avail_idx = vq->inuse + vq->used_idx;
if (vq->inuse) {
vq->resubmit_list = malloc(sizeof(VuVirtqInflightDesc) * vq->inuse);
vq->resubmit_list = calloc(vq->inuse, sizeof(VuVirtqInflightDesc));
if (!vq->resubmit_list) {
return -1;
}

View File

@ -77,7 +77,7 @@ static void vi_input_send(VuInput *vi, struct virtio_input_event *event)
len = iov_from_buf(elem->in_sg, elem->in_num,
0, &vi->queue[i].event, sizeof(virtio_input_event));
vu_queue_push(dev, vq, elem, len);
g_free(elem);
free(elem);
}
vu_queue_notify(&vi->dev.parent, vq);
@ -153,7 +153,7 @@ static void vi_handle_sts(VuDev *dev, int qidx)
0, &event, sizeof(event));
vi_handle_status(vi, &event);
vu_queue_push(dev, vq, elem, len);
g_free(elem);
free(elem);
}
vu_queue_notify(&vi->dev.parent, vq);

View File

@ -437,11 +437,11 @@ static void test_acpi_asl(test_data *data)
g_assert(!err || exp_err);
if (g_strcmp0(asl->str, exp_asl->str)) {
sdt->tmp_files_retain = true;
if (exp_err) {
fprintf(stderr,
"Warning! iasl couldn't parse the expected aml\n");
} else {
sdt->tmp_files_retain = true;
exp_sdt->tmp_files_retain = true;
fprintf(stderr,
"acpi-test: Warning! %.4s mismatch. "