Fix destroy_alloc_bitmap size
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 7 Mar 2024 17:29:50 +0000 (12:29 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 7 Mar 2024 17:29:50 +0000 (12:29 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic53da70a6fbcbbdd87c885d01d80a5ba65befb5a

src/rseq-percpu-alloc.c

index 8d0a2a5f237c58c61a9d3e340dde0b7415347e87..1bddaa25b05175af8fa29c82900136ab7073e317 100644 (file)
@@ -226,13 +226,12 @@ static
 void destroy_alloc_bitmap(struct rseq_percpu_pool *pool)
 {
        unsigned long *bitmap = pool->alloc_bitmap;
-       size_t item_len = pool->item_len;
        size_t count, total_leaks = 0;
 
        if (!bitmap)
                return;
 
-       count = (item_len + BIT_PER_ULONG - 1) / BIT_PER_ULONG;
+       count = ((pool->percpu_len >> pool->item_order) + BIT_PER_ULONG - 1) / BIT_PER_ULONG;
 
        /* Assert that all items in the pool were freed. */
        for (size_t k = 0; k < count; ++k)
This page took 0.024698 seconds and 4 git commands to generate.