ACK: [PATCH] lib: fwts_alloc: fix incorrect accounting on hash entry count
Alex Hung
alex.hung at canonical.com
Mon Feb 27 03:27:55 UTC 2017
On 2017-02-26 12:35 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> When hash entries are re-used we also need to bump the count of active
> entries to ensure we are tallying these correctly. This fixes a
> non-fatal issue where the accounting believes that all entries are freed
> when there could be some still being active and we end up prematurely
> cleaning up the hash table too early.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_alloc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/lib/src/fwts_alloc.c b/src/lib/src/fwts_alloc.c
> index f07cab8..c0d5e55 100644
> --- a/src/lib/src/fwts_alloc.c
> +++ b/src/lib/src/fwts_alloc.c
> @@ -73,6 +73,7 @@ static bool hash_alloc_add(void *addr, size_t size)
> /* old and free, so re-use */
> new->addr = addr;
> new->size = size;
> + hash_count++;
> return true;
> }
> /* something is wrong, already in use */
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list