From: Hans Verkuil Date: Mon, 2 May 2022 07:16:25 +0000 (+0200) Subject: media: videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc X-Git-Tag: v5.19-rc1~179^2~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5a8099c7512d94da2fd8cf99b8451278346cfcc;p=thirdparty%2Fkernel%2Flinux.git 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 Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index f8a21c560ad21..fa69158a65b1f 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -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 * attributes passed from the upper layer. */ - buf->pages = kvmalloc_array(buf->num_pages, sizeof(struct page *), - GFP_KERNEL | __GFP_ZERO); + buf->pages = kvcalloc(buf->num_pages, sizeof(struct page *), GFP_KERNEL); if (!buf->pages) goto fail_pages_array_alloc;