[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/35] hw/virtio: Fix leak of host-notifier memory-region
From: |
Michael S. Tsirkin |
Subject: |
[PULL 02/35] hw/virtio: Fix leak of host-notifier memory-region |
Date: |
Sat, 4 Sep 2021 17:35:59 -0400 |
From: Yajun Wu <yajunw@nvidia.com>
If call virtio_queue_set_host_notifier_mr fails, should free
host-notifier memory-region.
Fixes: 44866521bd ("vhost-user: support registering external host notifiers")
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Message-Id: <1629077555-19907-1-git-send-email-yajunw@nvidia.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 2407836fac..33002300c2 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -1474,6 +1474,7 @@ static int
vhost_user_slave_handle_vring_host_notifier(struct vhost_dev *dev,
g_free(name);
if (virtio_queue_set_host_notifier_mr(vdev, queue_idx, &n->mr, true)) {
+ object_unparent(OBJECT(&n->mr));
munmap(addr, page_size);
return -1;
}
--
MST
- [PULL 00/35] pc,pci,virtio: fixes, cleanups, Michael S. Tsirkin, 2021/09/04
- [PULL 01/35] vhost-vdpa: Do not send empty IOTLB update batches, Michael S. Tsirkin, 2021/09/04
- [PULL 02/35] hw/virtio: Fix leak of host-notifier memory-region,
Michael S. Tsirkin <=
- [PULL 03/35] vhost: make SET_VRING_ADDR, SET_FEATURES send replies, Michael S. Tsirkin, 2021/09/04
- [PULL 04/35] hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place, Michael S. Tsirkin, 2021/09/04
- [PULL 05/35] q35: catch invalid cpu hotplug configuration, Michael S. Tsirkin, 2021/09/04
- [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Michael S. Tsirkin, 2021/09/04
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/06
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Ani Sinha, 2021/09/07
- Re: [PULL 06/35] hw/acpi: refactor acpi hp modules so that targets can just use what they need, Philippe Mathieu-Daudé, 2021/09/07