Merge branch 'perf/rbtree_copy' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / media / v4l2-core / videobuf2-dma-contig.c
index 644dec73d2203fdffa67a035231f6fe7450278d2..94c1e6455d365de7faa1b4b0df14ce279820d5f2 100644 (file)
@@ -299,7 +299,6 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(
        /* stealing dmabuf mutex to serialize map/unmap operations */
        struct mutex *lock = &db_attach->dmabuf->lock;
        struct sg_table *sgt;
-       int ret;
 
        mutex_lock(lock);
 
@@ -318,8 +317,9 @@ static struct sg_table *vb2_dc_dmabuf_ops_map(
        }
 
        /* mapping to the client with new direction */
-       ret = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents, dma_dir);
-       if (ret <= 0) {
+       sgt->nents = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents,
+                               dma_dir);
+       if (!sgt->nents) {
                pr_err("failed to map scatterlist\n");
                mutex_unlock(lock);
                return ERR_PTR(-EIO);
This page took 0.029087 seconds and 5 git commands to generate.