diff mbox

[PATCHv4,1/3] linux-generic: shm: odp_shm_free bug fix

Message ID 1422016474-8676-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit c0ec4546cb4eb143d07a330ffee688b39a13e1e7
Headers show

Commit Message

Maxim Uvarov Jan. 23, 2015, 12:34 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>

Free should use the original address from mmap() and not the
align adjusted address.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@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);