summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSooChan Lim <sc1.lim@samsung.com>2019-04-01 15:31:50 +0900
committerSooChan Lim <sc1.lim@samsung.com>2019-04-01 15:31:50 +0900
commit0bcdc8f8aa4313415b6beb0ad23fce9c46cc2a24 (patch)
tree765d5f3c82a0a9f33534701bcd93cecf418234d2
parent4daf2ece2f263e18b9fa330ac220e289ea2e5628 (diff)
downloadlibtbm-shm-0bcdc8f8aa4313415b6beb0ad23fce9c46cc2a24.tar.gz
libtbm-shm-0bcdc8f8aa4313415b6beb0ad23fce9c46cc2a24.tar.bz2
libtbm-shm-0bcdc8f8aa4313415b6beb0ad23fce9c46cc2a24.zip
unmap the virtual address
Change-Id: I717a3cb558577dfa9eaf389a46c5f3f5da92b21e
-rw-r--r--src/tbm_bufmgr_shm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tbm_bufmgr_shm.c b/src/tbm_bufmgr_shm.c
index 29c3f90..8aa8835 100644
--- a/src/tbm_bufmgr_shm.c
+++ b/src/tbm_bufmgr_shm.c
@@ -53,6 +53,7 @@
#define DEBUG
#define TBM_COLOR_FORMAT_COUNT 4
+#define STRERR_BUFSIZE 128
#ifdef DEBUG
#define LOG_TAG "TBM_BACKEND"
@@ -702,11 +703,19 @@ static void
tbm_shm_bo_free(tbm_backend_bo_data *bo_data)
{
tbm_bo_shm bo_shm = (tbm_bo_shm)bo_data;
+ char buf[STRERR_BUFSIZE];
SHM_RETURN_IF_FAIL(bo_shm != NULL);
DBG(" [%s] bo:%p, shm:%d, size:%d\n", target_name(), bo_shm, bo_shm->fd, bo_shm->size);
+ if (bo_shm->pBase) {
+ if (munmap(bo_shm->pBase, bo_shm->size) == -1) {
+ TBM_ERR("bo_shm:%p fail to munmap(%s)\n",
+ bo_shm, strerror_r(errno, buf, STRERR_BUFSIZE));
+ }
+ }
+
/* Free shm object*/
close(bo_shm->fd);
free(bo_shm);