Skip to content

Commit cc8c036

Browse files
mszyprowmchehab
authored andcommitted
media: s5p-mfc: Properly handle dma_parms for the allocated devices
Commit 9495b7e ("driver core: platform: Initialize dma_parms for platform devices") in v5.7-rc5 added allocation of dma_parms structure to all platform devices. Then vb2_dma_contig_set_max_seg_size() have been changed not to allocate dma_parms structure and rely on the one allocated by the device core. Lets allocate the needed structure also for the devices created for the 2 MFC device memory ports. Reported-by: Tomi Valkeinen <[email protected]> Suggested-by: Ulf Hansson <[email protected]> Fixes: 9495b7e ("driver core: platform: Initialize dma_parms for platform devices") Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 15168b2 commit cc8c036

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/media/platform/s5p-mfc/s5p_mfc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,10 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
10891089
child->coherent_dma_mask = dev->coherent_dma_mask;
10901090
child->dma_mask = dev->dma_mask;
10911091
child->release = s5p_mfc_memdev_release;
1092+
child->dma_parms = devm_kzalloc(dev, sizeof(*child->dma_parms),
1093+
GFP_KERNEL);
1094+
if (!child->dma_parms)
1095+
goto err;
10921096

10931097
/*
10941098
* The memdevs are not proper OF platform devices, so in order for them
@@ -1104,7 +1108,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
11041108
return child;
11051109
device_del(child);
11061110
}
1107-
1111+
err:
11081112
put_device(child);
11091113
return NULL;
11101114
}

0 commit comments

Comments
 (0)