Skip to content
Commit 82f30156 authored by David Frey's avatar David Frey Committed by Jonathan Cameron
Browse files

iio: light: opt3001: fix mutex unlock race



When an end-of-conversion interrupt is received after performing a
single-shot reading of the light sensor, the driver was waking up the
result ready queue before checking opt->ok_to_ignore_lock to determine
if it should unlock the mutex. The problem occurred in the case where
the other thread woke up and changed the value of opt->ok_to_ignore_lock
to false prior to the interrupt thread performing its read of the
variable. In this case, the mutex would be unlocked twice.

Signed-off-by: default avatarDavid Frey <dpfrey@gmail.com>
Reviewed-by: default avatarAndreas Dannenberg <dannenberg@ti.com>
Fixes: 94a9b7b1

 ("iio: light: add support for TI's opt3001 light sensor")
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c62dd449
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment