|
@@ -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);
|