From f7809a2ee39b0ee8423fcb050bd98e3ad59ec6ad Mon Sep 17 00:00:00 2001 From: Bartosz Kokoszko Date: Thu, 25 Jul 2019 16:02:59 +0200 Subject: [PATCH] alloc: fix blocks update in alloc_cont_blocks() Add proper stop condition during block hdr update in alloc_cont_blocks() function. Signed-off-by: Bartosz Kokoszko --- src/lib/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/alloc.c b/src/lib/alloc.c index 61d180b10..dd55c964e 100644 --- a/src/lib/alloc.c +++ b/src/lib/alloc.c @@ -268,7 +268,7 @@ static void *alloc_cont_blocks(struct mm_heap *heap, int level, map->first_free += count; /* update each block */ - for (current = start; current < count; current++) { + for (current = start; current < start + count; current++) { hdr = &map->block[current]; hdr->used = 1; }