msm: camera_v2: Fix a return code issue in smmu mapping

This change fixed a return code bug in the cam smmu mapping
code.

Change-Id: Idff814e32fe3f5764f2ef678a68dad4eb0b8046d
Signed-off-by: Jing Zhou <jzhou70@codeaurora.org>
This commit is contained in:
Jing Zhou 2016-07-05 15:42:23 -07:00 committed by Gerrit - the friendly Code Review server
parent 9e4b3ba4af
commit 4f319d4ecd

View file

@ -788,8 +788,9 @@ static int cam_smmu_map_buffer_and_add_to_list(int idx, int ion_fd,
rc = msm_dma_map_sg_lazy(iommu_cb_set.cb_info[idx].dev, table->sgl,
table->nents, dma_dir, buf);
if (!rc) {
if (rc != table->nents) {
pr_err("Error: msm_dma_map_sg_lazy failed\n");
rc = -ENOMEM;
goto err_unmap_sg;
}