msm: mdss: fix error checking for dma_map_sg_lazy

dma_map_sg_lazy returns the nents value, ie the number of entries in
sglist which is passed on success. Error checking should be done based
on nents value and not on non-zero return value.

Change-Id: I341990fcd4eb123306fb8d1c3b08be85f0b7764b
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:
Veera Sundaram Sankaran 2015-08-13 15:29:55 -07:00 committed by David Keitel
parent e07af1b53a
commit 3fdd8450ea

View file

@ -265,7 +265,7 @@ static int mdss_smmu_map_dma_buf_v2(struct dma_buf *dma_buf,
ATRACE_BEGIN("map_buffer");
rc = msm_dma_map_sg_lazy(mdss_smmu->dev, table->sgl, table->nents, dir,
dma_buf);
if (!rc) {
if (rc != table->nents) {
pr_err("dma map sg failed\n");
return -ENOMEM;
}