Tomi Valkeinen bfcba38d95 media: ov5640: fix use of destroyed mutex
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>
2020-04-14 12:18:37 +02:00
..
2019-06-11 12:09:28 -04:00
2019-07-09 09:47:22 -07:00
2020-03-12 17:21:44 +01:00
2019-07-09 09:47:22 -07:00
2019-03-01 09:29:58 -05:00
2019-11-08 07:28:22 +01:00
2019-08-26 14:05:09 -03:00
2019-03-01 09:29:58 -05:00
2019-03-01 09:29:58 -05:00