linux_dsm_epyc7002/drivers/media
Tomi Valkeinen 0d96687213 media: videobuf2-dma-contig: fix bad kfree in vb2_dma_contig_clear_max_seg_size
Commit 9495b7e92f ("driver core: platform:
Initialize dma_parms for platform devices") in v5.7-rc5 causes
vb2_dma_contig_clear_max_seg_size() to kfree memory that was not
allocated by vb2_dma_contig_set_max_seg_size().

The assumption in vb2_dma_contig_set_max_seg_size() seems to be that
dev->dma_parms is always NULL when the driver is probed, and the case
where dev->dma_parms has bee initialized by someone else than the driver
(by calling vb2_dma_contig_set_max_seg_size) will cause a failure.

All the current users of these functions are platform devices, which now
always have dma_parms set by the driver core. To fix the issue for v5.7,
make vb2_dma_contig_set_max_seg_size() return an error if dma_parms is
NULL to be on the safe side, and remove the kfree code from
vb2_dma_contig_clear_max_seg_size().

For v5.8 we should remove the two functions and move the
dma_set_max_seg_size() calls into the drivers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Fixes: 9495b7e92f ("driver core: platform: Initialize dma_parms for platform devices")
Cc: stable@vger.kernel.org
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-06-11 19:20:55 +02:00
..
cec media: medium: cec: Make MEDIA_CEC_SUPPORT default to n if !MEDIA_SUPPORT 2020-06-11 19:19:50 +02:00
common media: videobuf2-dma-contig: fix bad kfree in vb2_dma_contig_clear_max_seg_size 2020-06-11 19:20:55 +02:00
dvb-core media: dvbdev: Fix tuner->demod media controller link 2020-05-25 09:09:05 +02:00
dvb-frontends media: dvb-frontends: remove redundant initialization of variable status 2020-05-12 17:33:31 +02:00
firewire
i2c media: s5k5baf: Replace zero-length array with flexible-array 2020-05-25 15:44:00 +02:00
mc media: entity: Pass entity to get_fwnode_pad operation 2020-05-18 11:12:05 +02:00
mmc
pci media: mantis_dvb: remove redundant initialization to variable result 2020-05-12 17:32:51 +02:00
platform media: s5p-mfc: Properly handle dma_parms for the allocated devices 2020-06-11 19:20:09 +02:00
radio
rc media: gpio-ir-tx: allow transmission without carrier 2020-05-12 17:30:40 +02:00
spi
test-drivers media: vimc: Make use of V4L2_CAP_IO_MC 2020-05-06 12:10:12 +02:00
tuners media: si2157: ensure wait_status is initialized 2020-04-29 11:59:57 +02:00
usb media: dvb-usb: Add Cinergy S2 PCIe Dual Port support 2020-05-25 09:09:39 +02:00
v4l2-core media: v4l2-ctrls: Add helper to register properties 2020-05-18 15:36:20 +02:00
Kconfig media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00
Makefile media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00