mirror of
https://github.com/apache/nuttx.git
synced 2025-05-08 22:32:04 +08:00
mm/kmap/kmm_map.c: Fix argument to gran_free
Fix a memory corruption & deadlocks while calling gran_free. The function expects a GRAN_HANDLE as a paramter, not a pointer to it. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
parent
8d635ed0bf
commit
19fe41cb1b
@ -159,7 +159,7 @@ static FAR void *map_pages(FAR void **pages, size_t npages, int prot)
|
||||
errout_with_pgmap:
|
||||
up_addrenv_kunmap_pages((uintptr_t)vaddr, npages);
|
||||
errout_with_vaddr:
|
||||
gran_free(&g_kmm_map_vpages, vaddr, size);
|
||||
gran_free(g_kmm_map_vpages, vaddr, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ void kmm_unmap(FAR void *kaddr)
|
||||
|
||||
/* Release the virtual memory area for use */
|
||||
|
||||
gran_free(&g_kmm_map_vpages, entry->vaddr, entry->length);
|
||||
gran_free(g_kmm_map_vpages, entry->vaddr, entry->length);
|
||||
|
||||
/* Remove the mapping from the kernel mapping list */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user