From: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> vb2_dc_get_base_sgt() which obtains the scatterlist already prints information on why the scatterlist could not be obtained. Also, remove the useless warning of a failed kmalloc(). Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 2a00d12ffee2..d59f107f0457 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -370,10 +370,8 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) struct sg_table *sgt; sgt = kmalloc(sizeof(*sgt), GFP_KERNEL); - if (!sgt) { - dev_err(buf->dev, "failed to alloc sg table\n"); + if (!sgt) return NULL; - } ret = dma_get_sgtable_attrs(buf->dev, sgt, buf->cookie, buf->dma_addr, buf->size, buf->attrs); @@ -400,7 +398,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) if (!buf->dma_sgt) buf->dma_sgt = vb2_dc_get_base_sgt(buf); - if (WARN_ON(!buf->dma_sgt)) + if (!buf->dma_sgt) return NULL; dbuf = dma_buf_export(&exp_info); -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html