summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchou Gan <yuchou.gan@nxp.com>2018-01-11 02:14:44 +0800
committerYuchou Gan <yuchou.gan@nxp.com>2018-01-11 02:16:39 +0800
commitbe5672bb1fc4871ffb8569b524c2969341384fd9 (patch)
tree01ec1d58e6f9af2e28e7fd744c5389d30705b2fa
parenta62fed2c43fc6ba909eddd175be3f036515ee10b (diff)
MGS-3565 [#ccc] fix coverity issue 1477294
unmap_attachment to free the sg_table when failed to call _DmabufAttach Date: Jan 10, 2018 Signed-off-by: Yuchou Gan<yuchou.gan@nxp.com>
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
index 1b60b4dfaa05..9459f7988960 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
@@ -288,6 +288,12 @@ OnError:
{
gcmkOS_SAFE_FREE(os, pagearray);
}
+
+ if(sgt)
+ {
+ dma_buf_unmap_attachment(attachment, sgt, DMA_BIDIRECTIONAL);
+ }
+
gcmkFOOTER();
return status;
}