[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] hw/rdma: Lock before destroy
From: |
Yuval Shaia |
Subject: |
[PATCH] hw/rdma: Lock before destroy |
Date: |
Tue, 24 Mar 2020 12:53:56 +0200 |
To protect from the case that users of the protected_qlist are still
using the qlist let's lock before detsroying it.
Reported-by: Coverity (CID 1421951)
Signed-off-by: Yuval Shaia <address@hidden>
---
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..55779cbef6 100644
--- a/hw/rdma/rdma_utils.c
+++ b/hw/rdma/rdma_utils.c
@@ -63,6 +63,7 @@ void rdma_protected_qlist_init(RdmaProtectedQList *list)
void rdma_protected_qlist_destroy(RdmaProtectedQList *list)
{
if (list->list) {
+ qemu_mutex_lock(&list->lock);
qlist_destroy_obj(QOBJECT(list->list));
qemu_mutex_destroy(&list->lock);
list->list = NULL;
--
2.25.1
- [PATCH] hw/rdma: Lock before destroy,
Yuval Shaia <=
- Re: [PATCH] hw/rdma: Lock before destroy, Peter Maydell, 2020/03/24
- Re: [PATCH] hw/rdma: Lock before destroy, Marcel Apfelbaum, 2020/03/24
- Re: [PATCH] hw/rdma: Lock before destroy, Yuval Shaia, 2020/03/24
- Re: [PATCH] hw/rdma: Lock before destroy, Peter Maydell, 2020/03/24
- Re: [PATCH] hw/rdma: Lock before destroy, Yuval Shaia, 2020/03/24
- Re: [PATCH] hw/rdma: Lock before destroy, Peter Maydell, 2020/03/24