From feab136f1ae64209976d7f1d3e3536705e1dd38a Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Tue, 6 Jun 2023 15:45:49 +0800 Subject: [PATCH] [allocator_dma_heap]: Add error log Signed-off-by: Herman Chen Change-Id: I06af727713e1c096eada8a40795f42668fdaff6d --- osal/allocator/allocator_dma_heap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osal/allocator/allocator_dma_heap.c b/osal/allocator/allocator_dma_heap.c index d3e59cad..6eee08d5 100644 --- a/osal/allocator/allocator_dma_heap.c +++ b/osal/allocator/allocator_dma_heap.c @@ -103,11 +103,12 @@ static int dma_heap_alloc(int fd, size_t len, RK_S32 *dmabuf_fd, RK_U32 flags) data.heap_flags = 0; // heap_flags should be set to 0 ret = ioctl(fd, DMA_HEAP_IOCTL_ALLOC, &data); - - dma_heap_dbg(DMA_HEAP_IOCTL, "ioctl alloc ret %d %s\n", ret, strerror(errno)); - - if (ret < 0) + if (ret < 0) { + mpp_err("ioctl alloc failed for %s\n", strerror(errno)); return ret; + } + + dma_heap_dbg(DMA_HEAP_IOCTL, "ioctl alloc get fd %d\n", data.fd); *dmabuf_fd = data.fd;