diff mbox series

[v3,21/23] hw/rdma: Do not use bitmap_zero_extend to free bitmap

Message ID 20181113071336.6242-22-yuval.shaia@oracle.com (mailing list archive)
State New, archived
Headers show
Series Add support for RDMA MAD | expand

Commit Message

Yuval Shaia Nov. 13, 2018, 7:13 a.m. UTC
bitmap_zero_extend is designed to work for extending, not for
shrinking.
Using g_free instead.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
 hw/rdma/rdma_rm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcel Apfelbaum Nov. 17, 2018, 12:25 p.m. UTC | #1
On 11/13/18 9:13 AM, Yuval Shaia wrote:
> bitmap_zero_extend is designed to work for extending, not for
> shrinking.
> Using g_free instead.
>
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
>   hw/rdma/rdma_rm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c
> index 0a5ab8935a..35a96d9a64 100644
> --- a/hw/rdma/rdma_rm.c
> +++ b/hw/rdma/rdma_rm.c
> @@ -43,7 +43,7 @@ static inline void res_tbl_free(RdmaRmResTbl *tbl)
>   {
>       qemu_mutex_destroy(&tbl->lock);
>       g_free(tbl->tbl);
> -    bitmap_zero_extend(tbl->bitmap, tbl->tbl_sz, 0);
> +    g_free(tbl->bitmap);
>   }
>   
>   static inline void *res_tbl_get(RdmaRmResTbl *tbl, uint32_t handle)

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

Thanks,
Marcel
diff mbox series

Patch

diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c
index 0a5ab8935a..35a96d9a64 100644
--- a/hw/rdma/rdma_rm.c
+++ b/hw/rdma/rdma_rm.c
@@ -43,7 +43,7 @@  static inline void res_tbl_free(RdmaRmResTbl *tbl)
 {
     qemu_mutex_destroy(&tbl->lock);
     g_free(tbl->tbl);
-    bitmap_zero_extend(tbl->bitmap, tbl->tbl_sz, 0);
+    g_free(tbl->bitmap);
 }
 
 static inline void *res_tbl_get(RdmaRmResTbl *tbl, uint32_t handle)