From 6cb164f551abfda045326ceb50bb4e5966a990c1 Mon Sep 17 00:00:00 2001 From: Vincent Stehlé Date: Mon, 18 Jul 2016 14:54:04 -0300 Subject: [media] vb2: Fix allocation size of dma_parms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When allocating memory to hold the device dma parameters in vb2_dma_contig_set_max_seg_size(), the requested size is by mistake only the size of a pointer. Request the correct size instead. Fixes: 3f0339691896 ("media: vb2-dma-contig: add helper for setting dma max seg size") Signed-off-by: Vincent Stehlé Cc: Sylwester Nawrocki Acked-by: Marek Szyprowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/videobuf2-dma-contig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/v4l2-core') diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 863f658a3fa1..fe50a0420c7c 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c @@ -749,7 +749,7 @@ EXPORT_SYMBOL_GPL(vb2_dma_contig_memops); int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size) { if (!dev->dma_parms) { - dev->dma_parms = kzalloc(sizeof(dev->dma_parms), GFP_KERNEL); + dev->dma_parms = kzalloc(sizeof(*dev->dma_parms), GFP_KERNEL); if (!dev->dma_parms) return -ENOMEM; } -- cgit v1.2.3