Skip to contentSkip to conversation

hw/rdma: Destroy list mutex when list is destroyed

PATCH In review Yuval Shaia 2 participants 2 messages Apr 13, 2020 – Apr 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/rdma: Destroy list mutex when list is destroyed

List mutex should be destroyed when gs list gets destroyed.

---
 hw/rdma/rdma_utils.c | 1 +
 1 file changed, 1 insertion(+)
hw/rdma/rdma_utils.c +1 -0
index 73f279104c..698ed4716c 100644
@@ -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;
     }
 }
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Yuval,

Quoted 13 lines · Yuval Shaia

List mutex should be destroyed when gs list gets destroyed.

---
  hw/rdma/rdma_utils.c | 1 +
  1 file changed, 1 insertion(+)
hw/rdma/rdma_utils.c +0 -0
index 73f279104c..698ed4716c 100644

hw/rdma/rdma_utils.c void rdma_protected_gslist_destroy(RdmaProtectedGSList *list) · line 106

Quoted 7 lines
hw/rdma/rdma_utils.c +1 -0
@@ -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;
      }
  }

Thanks,
Marcel