[PATCH] hw/rdma: Destroy list mutex when list is destroyed

Yuval Shaia posted 1 patch 4 years ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200413085738.11145-1-yuval.shaia.ml@gmail.com
Maintainers: Yuval Shaia <yuval.shaia.ml@gmail.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/rdma/rdma_utils.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] hw/rdma: Destroy list mutex when list is destroyed
Posted by Yuval Shaia 4 years ago
List mutex should be destroyed when gs list gets destroyed.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
---
 hw/rdma/rdma_utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c
index 73f279104c..698ed4716c 100644
--- a/hw/rdma/rdma_utils.c
+++ b/hw/rdma/rdma_utils.c
@@ -100,6 +100,7 @@ void rdma_protected_gslist_destroy(RdmaProtectedGSList *list)
 {
     if (list->list) {
         g_slist_free(list->list);
+        qemu_mutex_destroy(&list->lock);
         list->list = NULL;
     }
 }
-- 
2.20.1


Re: [PATCH] hw/rdma: Destroy list mutex when list is destroyed
Posted by Marcel Apfelbaum 4 years ago
Hi Yuval,

On 4/13/20 11:57 AM, Yuval Shaia wrote:
> List mutex should be destroyed when gs list gets destroyed.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
> ---
>   hw/rdma/rdma_utils.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c
> index 73f279104c..698ed4716c 100644
> --- a/hw/rdma/rdma_utils.c
> +++ b/hw/rdma/rdma_utils.c
> @@ -100,6 +100,7 @@ void rdma_protected_gslist_destroy(RdmaProtectedGSList *list)
>   {
>       if (list->list) {
>           g_slist_free(list->list);
> +        qemu_mutex_destroy(&list->lock);
>           list->list = NULL;
>       }
>   }

Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com>

Thanks,
Marcel