提交 d5a8099c 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

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: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@kernel.org>
上级 1577d804
...@@ -126,8 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册