Merge tag 'module_init-device_initcall-v4.1-rc8' of git://git.kernel.org/pub/scm...
[deliverable/linux.git] / drivers / media / v4l2-core / videobuf2-vmalloc.c
index 657ab302a5cf457549e151e603b3cc60e5f90be1..2fe4c27f524a85d9732ba4cbc72f5979f954466f 100644 (file)
@@ -287,7 +287,6 @@ static struct sg_table *vb2_vmalloc_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);
 
@@ -306,8 +305,9 @@ static struct sg_table *vb2_vmalloc_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.027454 seconds and 5 git commands to generate.