aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGowtham Tammana2016-11-01 14:25:07 -0500
committerBuddy Liong2016-11-01 16:21:54 -0500
commit7fa95bf6b4db76a56b6439d8da4b589736fc99f4 (patch)
treeda3e90f7b78d404d5caa88a87f44d1a4df2cb229
parent1b1b5a2e5e995f607c22651579b49aa98d08610a (diff)
downloadrepo-libdce-7fa95bf6b4db76a56b6439d8da4b589736fc99f4.tar.gz
repo-libdce-7fa95bf6b4db76a56b6439d8da4b589736fc99f4.tar.xz
repo-libdce-7fa95bf6b4db76a56b6439d8da4b589736fc99f4.zip
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
119 } 119 }
120 120
121 h = omap_bo_map(bo); 121 h = omap_bo_map(bo);
122
123 h->ptr = h + 1;
122 memset(H2P(h), 0, sz); 124 memset(H2P(h), 0, sz);
125
123 h->size = sz; 126 h->size = sz;
124 h->ptr = h + sizeof(MemHeader);
125 /* get the fd from drm which needs to be closed by memplugin_free */ 127 /* get the fd from drm which needs to be closed by memplugin_free */
126 h->dma_buf_fd = omap_bo_dmabuf(bo); 128 h->dma_buf_fd = omap_bo_dmabuf(bo);
127 h->region = region; 129 h->region = region;