summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2012-10-29 19:20:28 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2012-10-29 19:20:28 +0100
commit21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e (patch)
tree6e70b7fc86c6783c557931adaead1a3ff3c48cc5
parent55961a80260cedc25eab90800253feaa94cffd16 (diff)
downloadipecamera-21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e.tar.gz
ipecamera-21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e.tar.bz2
ipecamera-21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e.tar.xz
ipecamera-21b136f8538df45f2fc0b0ef100a5eaeacf5ac9e.zip
Do not return DMA buffer in streaming read if the callback returns error
-rw-r--r--dma/nwl_engine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dma/nwl_engine.c b/dma/nwl_engine.c
index fc07ccd..e4c102d 100644
--- a/dma/nwl_engine.c
+++ b/dma/nwl_engine.c
@@ -299,10 +299,10 @@ int dma_nwl_stream_read(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, uin
pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_FROMDEVICE, bufnum);
void *buf = pcilib_kmem_get_block_ua(ctx->pcilib, info->pages, bufnum);
ret = cb(cbattr, (eop?PCILIB_DMA_FLAG_EOP:0), bufsize, buf);
+ if (ret < 0) return -ret;
// DS: Fixme, it looks like we can avoid calling this for the sake of performance
// pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_TODEVICE, bufnum);
dma_nwl_return_buffer(ctx, info);
- if (ret < 0) return -ret;
res += bufsize;