diff options
author | Eugenio Pérez <eperezma@redhat.com> | 2022-08-23 20:20:04 +0200 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2022-09-02 10:22:39 +0800 |
commit | 69292a8e40f4dae8af5f04724e06392cdf03c09e (patch) | |
tree | b696af6c4f0145432adff7ed82427e9cf36d7126 /hw/virtio/vhost-iova-tree.h | |
parent | 7dab70bec397e3522211e7bcc36d879bad8154c5 (diff) |
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 'hw/virtio/vhost-iova-tree.h')
-rw-r--r-- | hw/virtio/vhost-iova-tree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/vhost-iova-tree.h b/hw/virtio/vhost-iova-tree.h index 6a4f24e0f9..4adfd79ff0 100644 --- a/hw/virtio/vhost-iova-tree.h +++ b/hw/virtio/vhost-iova-tree.h @@ -22,6 +22,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(VhostIOVATree, vhost_iova_tree_delete); const DMAMap *vhost_iova_tree_find_iova(const VhostIOVATree *iova_tree, const DMAMap *map); int vhost_iova_tree_map_alloc(VhostIOVATree *iova_tree, DMAMap *map); -void vhost_iova_tree_remove(VhostIOVATree *iova_tree, const DMAMap *map); +void vhost_iova_tree_remove(VhostIOVATree *iova_tree, DMAMap map); #endif |