aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-sensor.c
diff options
context:
space:
mode:
authorHelen Koike <[email protected]>2019-05-17 17:20:11 +0000
committerMauro Carvalho Chehab <[email protected]>2019-05-28 17:10:49 +0000
commitee1c71a8e1456ab53fe667281d855849edf26a4d (patch)
tree70ffac1ed3ade7cbaae59530feba0af01ffc657c /drivers/media/platform/vimc/vimc-sensor.c
parentmedia: v4l2-core: fix use-after-free error (diff)
downloadkernel-ee1c71a8e1456ab53fe667281d855849edf26a4d.tar.gz
kernel-ee1c71a8e1456ab53fe667281d855849edf26a4d.zip
media: vimc: fix component match compare
If the system has other devices being registered in the component framework, the compare function will be called with a device that doesn't belong to vimc. This device is not necessarily a platform_device, nor have a platform_data (which causes a NULL pointer dereference error) and if it does have a pdata, it is not necessarily type of struct vimc_platform_data. So casting to any of these types is wrong. Instead of expecting a given pdev with a given pdata, just expect for the device it self. vimc-core is the one who creates them, we know in advance exactly which object to expect in the match. Fixes: 4a29b7090749 ("[media] vimc: Subdevices as modules") Signed-off-by: Helen Koike <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Tested-by: Boris Brezillon <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-sensor.c')
0 files changed, 0 insertions, 0 deletions