1
0
Fork 0

[media] vb2: Fix allocation size of dma_parms

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: 3f03396918 ("media: vb2-dma-contig: add helper for setting dma max seg size")

Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
hifive-unleashed-5.1
Vincent Stehlé 2016-07-18 14:54:04 -03:00 committed by Mauro Carvalho Chehab
parent 9f8b333308
commit 6cb164f551
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}