From: Stefano Garzarella <sgarzare@redhat.com>
To: Yajun Wu <yajunw@nvidia.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [PATCH] hw/virtio: Fix leak of host-notifier memory-region
Date: Thu, 12 Aug 2021 12:36:57 +0200 [thread overview]
Message-ID: <20210812103657.jgdtu45pjni4i3j7@steredhat> (raw)
In-Reply-To: <1628732246-34765-1-git-send-email-yajunw@nvidia.com>
On Thu, Aug 12, 2021 at 04:37:26AM +0300, Yajun Wu via wrote:
>If call virtio_queue_set_host_notifier_mr fails, should free
>host-notifier memory-region.
>
We can add:
Fixes: 44866521bd ("vhost-user: support registering external host notifiers")
>Signed-off-by: Yajun Wu <yajunw@nvidia.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 aec6cc1..3ae5297 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;
> }
>--
>1.8.3.1
>
>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
prev parent reply other threads:[~2021-08-12 10:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 1:37 [PATCH] hw/virtio: Fix leak of host-notifier memory-region Yajun Wu via
2021-08-12 10:36 ` Stefano Garzarella [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210812103657.jgdtu45pjni4i3j7@steredhat \
--to=sgarzare@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yajunw@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).