From: Laurent Pinchart Date: Sun, 9 Mar 2014 20:58:37 +0000 (-0300) Subject: [media] omap3isp: queue: Fix the dma_map_sg() return value check X-Git-Tag: firefly_0821_release~176^2~3754^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b8d642826d031c8700ff1ad601fedf1ebe351033;p=firefly-linux-kernel-4.4.55.git [media] omap3isp: queue: Fix the dma_map_sg() return value check dma_map_sg() can merge sglist entries, and can thus return a number of mapped entries different than the original value. Don't consider this as an error. Signed-off-by: Laurent Pinchart Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/omap3isp/ispqueue.c b/drivers/media/platform/omap3isp/ispqueue.c index 2fd254f4dbe2..479d348bb510 100644 --- a/drivers/media/platform/omap3isp/ispqueue.c +++ b/drivers/media/platform/omap3isp/ispqueue.c @@ -465,7 +465,7 @@ static int isp_video_buffer_prepare(struct isp_video_buffer *buf) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; ret = dma_map_sg(buf->queue->dev, buf->sgt.sgl, buf->sgt.orig_nents, direction); - if (ret != buf->sgt.orig_nents) { + if (ret <= 0) { ret = -EFAULT; goto done; }