memory: fix wrong calculation of remaining free blocks

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>

This patch corrects the calculation of free blocks.
Now, once we allocate all free space, the allocator
will go beyond available space.
This commit is contained in:
Marcin Rajwa 2019-04-09 23:25:11 +02:00 committed by Tomasz Lauda
parent ed6ac05f6b
commit 8397684e85
1 changed files with 1 additions and 2 deletions

View File

@ -258,8 +258,7 @@ static void *alloc_cont_blocks(struct mm_heap *heap, int level,
/* check if we have enough consecutive blocks for requested
* allocation size.
*/
for (current = map->first_free; current < map->count ||
count > remaining; current++) {
for (current = map->first_free; current < map->count; current++) {
hdr = &map->block[current];
if (!hdr->used)