Skip to content
Snippets Groups Projects
Commit 047d2700 authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

Increment the DMA counter if gralloc_alloc completes successfully


There was "delete cb" without decrementing the DMA counter which
could lead to a leak.

Bug: 128324105
Test: make
Change-Id: I7307c133a84132e76648fbfe1e60e49a5ef477dc
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
parent 3bf47950
No related branches found
No related tags found
No related merge requests found
......@@ -709,15 +709,6 @@ static int gralloc_alloc(alloc_device_t* dev,
}
cb->setFd(fd);
hostCon->lock();
if (rcEnc->getDmaVersion() > 0) {
D("%s: creating goldfish dma region of size %lu (cb fd %d)\n", __FUNCTION__, ashmem_size, cb->fd);
init_gralloc_dmaregion();
get_gralloc_dmaregion();
}
hostCon->unlock();
}
if (needHostCb) {
......@@ -776,6 +767,14 @@ static int gralloc_alloc(alloc_device_t* dev,
*pStride = stride;
break;
}
hostCon->lock();
if (rcEnc->getDmaVersion() > 0) {
init_gralloc_dmaregion();
get_gralloc_dmaregion();
}
hostCon->unlock();
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment