diff mbox

[1/2] linux-generic: shm: odp_shm_free bug fix

Message ID 1421936710-21648-1-git-send-email-petri.savolainen@linaro.org
State Superseded
Headers show

Commit Message

Petri Savolainen Jan. 22, 2015, 2:25 p.m. UTC
Free should use the original address from mmap() and not the
align adjusted address.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 platform/linux-generic/odp_shared_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index 99c5b40..7d54f09 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -135,7 +135,7 @@  int odp_shm_free(odp_shm_t shm)
 	shm_block = &odp_shm_tbl->block[i];
 
 	alloc_size = shm_block->size + shm_block->align;
-	ret = munmap(shm_block->addr, alloc_size);
+	ret = munmap(shm_block->addr_orig, alloc_size);
 	if (0 != ret) {
 		ODP_DBG("odp_shm_free: munmap failed\n");
 		odp_spinlock_unlock(&odp_shm_tbl->lock);