From a640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 19 Dec 2014 00:14:21 +0100 Subject: Initial implementation of IPEDMA, dummy driver for KAPTURE, start of API changes --- dma/nwl_engine_buffers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dma/nwl_engine_buffers.h') diff --git a/dma/nwl_engine_buffers.h b/dma/nwl_engine_buffers.h index 826a4d5..c45c3ca 100644 --- a/dma/nwl_engine_buffers.h +++ b/dma/nwl_engine_buffers.h @@ -94,10 +94,10 @@ static int dma_nwl_allocate_engine_buffers(nwl_dma_t *ctx, pcilib_nwl_engine_des pcilib_kmem_handle_t *ring = pcilib_alloc_kernel_memory(ctx->pcilib, PCILIB_KMEM_TYPE_CONSISTENT, 1, PCILIB_NWL_DMA_PAGES * PCILIB_NWL_DMA_DESCRIPTOR_SIZE, PCILIB_NWL_ALIGNMENT, PCILIB_KMEM_USE(PCILIB_KMEM_USE_DMA_RING, sub_use), flags); pcilib_kmem_handle_t *pages = pcilib_alloc_kernel_memory(ctx->pcilib, type, PCILIB_NWL_DMA_PAGES, 0, 0, PCILIB_KMEM_USE(PCILIB_KMEM_USE_DMA_PAGES, sub_use), flags); - if (err) { + if (!ring||!pages) { if (pages) pcilib_free_kernel_memory(ctx->pcilib, pages, 0); - if (ring) pcilib_free_kernel_memory(ctx->pcilib, ring, 0); - return err; + if (ring) pcilib_free_kernel_memory(ctx->pcilib, ring, 0); + return PCILIB_ERROR_MEMORY; } reuse_ring = pcilib_kmem_is_reused(ctx->pcilib, ring); -- cgit v1.2.3