kernel_optimize_test/drivers/media
Nikhil Devshatwar c786595beb [media] media: ti-vpe: vpdma: Fix race condition for firmware loading
vpdma_create API is supposed to allocated the struct vpdma_data and
return it to the driver. Also, it would call the callback function
when the VPDMA firmware is loaded.

Typically, VPE driver have following function call:
    dev->vpdma = vpdma_create(pdev, firmware_load_callback);
And the callback implementation would continue the probe further.
Also, the dev->vpdma is accessed from the callback implementation.

This may lead to race condition between assignment of dev->vpdma
and the callback function being triggered.
This would lead to kernel crash because of NULL pointer access.

Fix this by passing a driver wrapped &vpdma_data instead of allocating
inside vpdma_create.
Change the vpdma_create prototype accordingly and fix return paths.

Also, update the VPE driver to use the updated API and
initialize the dev->vpdma before hand so that the race condition
is avoided.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-22 08:07:28 -02:00
..
cec [media] cec: ignore messages that we initiated 2016-11-22 05:43:07 -02:00
common [media] dvb: make DVB frontend *_ops instances "const" 2016-11-18 15:00:22 -02:00
dvb-core Revert "[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations" 2016-11-18 20:44:33 -02:00
dvb-frontends Revert "[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations" 2016-11-18 20:44:33 -02:00
firewire [media] firewire: don't break long lines 2016-10-21 10:06:00 -02:00
i2c [media] tvp5150: get rid of KERN_CONT 2016-11-18 10:11:09 -02:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci [media] zoran: fix spelling mistake in dprintk message 2016-11-22 05:41:56 -02:00
platform [media] media: ti-vpe: vpdma: Fix race condition for firmware loading 2016-11-22 08:07:28 -02:00
radio [media] wl128x: use KERNEL_CONT where needed 2016-11-18 09:37:24 -02:00
rc [media] serial_ir: fix reference to 8250 serial code 2016-11-22 06:17:44 -02:00
spi [media] gs1662: drop kfree for memory allocated with devm_kzalloc 2016-10-24 17:59:08 -02:00
tuners Revert "[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations" 2016-11-18 20:44:33 -02:00
usb [media] dvb-usb: remove another redundant #include <linux/kconfig.h> 2016-11-21 14:30:01 -02:00
v4l2-core [media] tuner-core: use pr_foo, instead of internal printk macros 2016-11-18 10:04:28 -02:00
cec-edid.c [media] cec-edid: check for IEEE identifier 2016-08-22 14:04:51 -03:00
Kconfig [media] Kconfig: fix breakages when DVB_CORE is not selected 2016-11-18 17:59:17 -02:00
Makefile [media] cec: move the CEC framework out of staging and to media 2016-11-16 15:40:20 -02:00
media-device.c [media] drivers/media/media-device: fix double free bug in _unregister() 2016-11-18 15:29:27 -02:00
media-devnode.c [media] media: fix media devnode ioctl/syscall and unregister race 2016-06-15 17:59:28 -03:00
media-entity.c [media] media-entity: clear media_gobj.mdev in _destroy() 2016-11-18 15:19:16 -02:00