linux/drivers/media
Hans Verkuil 6cf11ee630 [media] vb2: fix vb2_thread_stop race conditions
The locking scheme inside the vb2 thread is unsafe when stopping the
thread. In particular kthread_stop was called *after* internal data
structures were cleaned up instead of doing that before. In addition,
internal vb2 functions were called after threadio->stop was set to
true and vb2_internal_streamoff was called. This is also not allowed.

All this led to a variety of race conditions and kernel warnings and/or
oopses.

Fixed by moving the kthread_stop call up before the cleanup takes
place, and by checking threadio->stop before calling internal vb2
queuing operations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.16 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-21 21:07:26 -02:00
..
common [media] siano: unnecessary check before rc_unregister_device() 2014-11-25 13:44:34 -02:00
dvb-core [media] cxusb: Geniatech T230 support 2014-11-25 09:15:54 -02:00
dvb-frontends [media] stv090x: add an extra protetion against buffer overflow 2014-12-04 15:28:46 -02:00
firewire [media] firewire: Deletion of an unnecessary check before the function call "dvb_unregister_device" 2014-11-25 13:30:31 -02:00
i2c [media] vino/saa7191: move to staging in preparation for removal 2014-12-16 23:21:42 -02:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
pci [media] cx23885: Split Hauppauge WinTV Starburst from HVR4400 card entry 2015-01-21 21:02:34 -02:00
platform [media] rcar_vin: Update device_caps and capabilities in querycap 2015-01-21 21:05:58 -02:00
radio [media] media/radio: fix querycap 2014-12-02 11:30:55 -02:00
rc [media] img-ir: Don't set driver's module owner 2014-12-04 15:42:15 -02:00
tuners [media] si2157: One function call less in si2157_init() after error 2014-12-04 15:28:51 -02:00
usb [media] Fix Mygica T230 support 2015-01-21 21:03:39 -02:00
v4l2-core [media] vb2: fix vb2_thread_stop race conditions 2015-01-21 21:07:26 -02:00
Kconfig [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
Makefile [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c [media] media-devnode: just return 0 instead of using a var 2014-09-03 17:59:28 -03:00
media-entity.c [media] media: Fix a compiler warning in media_entity_pipeline_start() 2014-11-03 19:09:13 -02:00