summaryrefslogtreecommitdiffstats
path: root/dma/nwl_engine_buffers.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2014-12-19 00:14:21 +0100
committerSuren A. Chilingaryan <csa@suren.me>2014-12-19 00:14:21 +0100
commita640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f (patch)
tree7a6b899c130510e3cca87c23b26a5a1ffc033f20 /dma/nwl_engine_buffers.h
parent0e16eeef08ed9b27f0fbc7f02a562a81e10c4119 (diff)
downloadpcitool-a640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f.tar.gz
pcitool-a640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f.tar.bz2
pcitool-a640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f.tar.xz
pcitool-a640c40c6bcf4bad0b78e0ea6ea04f2a5f3f877f.zip
Initial implementation of IPEDMA, dummy driver for KAPTURE, start of API changes
Diffstat (limited to 'dma/nwl_engine_buffers.h')
-rw-r--r--dma/nwl_engine_buffers.h6
1 files changed, 3 insertions, 3 deletions
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);