media: videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc

Fixes smatch warning:

drivers/media/common/videobuf2/videobuf2-dma-sg.c:129 vb2_dma_sg_alloc() warn: Please consider using kvcalloc instead

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Hans Verkuil 2022-05-02 09:16:25 +02:00 committed by Mauro Carvalho Chehab
parent 1577d8043b
commit d5a8099c75

View file

@ -126,8 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev,
* there is no memory consistency guarantee, hence dma-sg ignores DMA * there is no memory consistency guarantee, hence dma-sg ignores DMA
* attributes passed from the upper layer. * attributes passed from the upper layer.
*/ */
buf->pages = kvmalloc_array(buf->num_pages, sizeof(struct page *), buf->pages = kvcalloc(buf->num_pages, sizeof(struct page *), GFP_KERNEL);
GFP_KERNEL | __GFP_ZERO);
if (!buf->pages) if (!buf->pages)
goto fail_pages_array_alloc; goto fail_pages_array_alloc;