linux-uconsole/drivers/media
Tomi Valkeinen d40e450583 media: ov5640: fix use of destroyed mutex
commit bfcba38d95 upstream.

v4l2_ctrl_handler_free() uses hdl->lock, which in ov5640 driver is set
to sensor's own sensor->lock. In ov5640_remove(), the driver destroys the
sensor->lock first, and then calls v4l2_ctrl_handler_free(), resulting
in the use of the destroyed mutex.

Fix this by calling moving the mutex_destroy() to the end of the cleanup
sequence, as there's no need to destroy the mutex as early as possible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org # v4.14+
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-22 09:05:27 +02:00
..
cec media: cec: silence shift wrapping warning in __cec_s_log_addrs() 2020-06-22 09:05:15 +02:00
common media: videobuf2-dma-sg: Prevent size from overflowing 2019-07-26 09:14:24 +02:00
dvb-core media: don't drop front-end reference count for ->detach 2019-10-05 13:10:05 +02:00
dvb-frontends media: dvb-frontends: use ida for pll number 2019-10-05 13:09:46 +02:00
firewire media: firewire: Fix app_info parameter type in avc_ca{,_app}_info 2019-01-26 09:32:37 +01:00
i2c media: ov5640: fix use of destroyed mutex 2020-06-22 09:05:27 +02:00
mmc
pci media: cx23885: Add support for AVerMedia CE310B 2020-02-24 08:34:41 +01:00
platform media: platform: fcp: Set appropriate DMA parameters 2020-06-22 09:05:13 +02:00
radio media: si470x-i2c: Move free() past last use of 'radio' 2020-02-05 14:43:40 +00:00
rc media: rc: IR signal for Panasonic air conditioner too long 2020-04-13 10:45:01 +02:00
spi media: cxd2880-spi: fix probe when dvb_attach fails 2019-12-13 08:52:23 +01:00
tuners media: si2157: Better check for running tuner in init 2020-06-22 09:05:09 +02:00
usb media: go7007: fix a miss of snd_card_free 2020-06-22 09:05:26 +02:00
v4l2-core media: v4l2-mem2mem.c: fix broken links 2020-03-11 14:15:03 +01:00
Kconfig
Makefile
media-device.c media: mc-device.c: don't memset __user pointer contents 2019-07-26 09:14:02 +02:00
media-devnode.c
media-entity.c