diff options
author | Eugenio Pérez | 2022-08-23 20:20:04 +0200 |
---|---|---|
committer | Jason Wang | 2022-09-02 04:22:39 +0200 |
commit | 69292a8e40f4dae8af5f04724e06392cdf03c09e (patch) | |
tree | b696af6c4f0145432adff7ed82427e9cf36d7126 /net | |
parent | vdpa: do not save failed dma maps in SVQ iova tree (diff) | |
download | qemu-69292a8e40f4dae8af5f04724e06392cdf03c09e.tar.gz qemu-69292a8e40f4dae8af5f04724e06392cdf03c09e.tar.xz qemu-69292a8e40f4dae8af5f04724e06392cdf03c09e.zip |
util: accept iova_tree_remove_parameter by value
It's convenient to call iova_tree_remove from a map returned from
iova_tree_find or iova_tree_find_iova. With the current code this is not
possible, since we will free it, and then we will try to search for it
again.
Fix it making accepting the map by value, forcing a copy of the
argument. Not applying a fixes tag, since there is no use like that at
the moment.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/vhost-vdpa.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 303447a68e..a49e7e649d 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -244,7 +244,7 @@ static void vhost_vdpa_cvq_unmap_buf(struct vhost_vdpa *v, void *addr) error_report("Device cannot unmap: %s(%d)", g_strerror(r), r); } - vhost_iova_tree_remove(tree, map); + vhost_iova_tree_remove(tree, *map); } static size_t vhost_vdpa_net_cvq_cmd_len(void) @@ -297,7 +297,7 @@ static bool vhost_vdpa_cvq_map_buf(struct vhost_vdpa *v, return true; dma_map_err: - vhost_iova_tree_remove(v->iova_tree, &map); + vhost_iova_tree_remove(v->iova_tree, map); return false; } |