aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGowtham Tammana <g-tammana@ti.com>2016-11-01 14:25:07 -0500
committerBuddy Liong <buddy.liong@ti.com>2016-11-01 16:21:54 -0500
commit7fa95bf6b4db76a56b6439d8da4b589736fc99f4 (patch)
treeda3e90f7b78d404d5caa88a87f44d1a4df2cb229
parent1b1b5a2e5e995f607c22651579b49aa98d08610a (diff)
downloaddce-7fa95bf6b4db76a56b6439d8da4b589736fc99f4.tar.gz
memplugin android: Fix h->ptr offset in memplugin_alloc
In memplugin_alloc(), the buffer pointer is meant to start at the end of the MemHeader structure. h->ptr which holds this offset is calculated incorrectly, but this has not caused any errors as the h->ptr is not referenced directly. This offset is acquired through `H2P` macroin the code. Nevertheless fixing the pointer arithmetic. Change-Id: I075455860fbeb54001a9f2fde1de544c39fe3ed0 Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rw-r--r--memplugin_android.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/memplugin_android.c b/memplugin_android.c
index f16a976..22a5564 100644
--- a/memplugin_android.c
+++ b/memplugin_android.c
@@ -119,9 +119,11 @@ void *memplugin_alloc(int sz, int height, MemRegion region, int align, int flags
}
h = omap_bo_map(bo);
+
+ h->ptr = h + 1;
memset(H2P(h), 0, sz);
+
h->size = sz;
- h->ptr = h + sizeof(MemHeader);
/* get the fd from drm which needs to be closed by memplugin_free */
h->dma_buf_fd = omap_bo_dmabuf(bo);
h->region = region;