summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorAlison Schofield <amsfield22@gmail.com>2017-01-21 19:28:52 -0800
committerJonathan Cameron <jic23@kernel.org>2017-01-22 13:21:41 +0000
commitd5d24bcc0a10a755ee77149e2f311c4ddafc19db (patch)
tree0f6a7162c45ffd3c6b6a758ffc567958b42762ae /ipc
parentdfebd8d81dc69afa9f20459ec9839f857f8c135f (diff)
downloadlinux-d5d24bcc0a10a755ee77149e2f311c4ddafc19db.tar.bz2
iio: trigger: close race condition in acquiring trigger reference
In iio_trigger_write_current() we find the trigger we want while holding mutex on the list of triggers, but we don't actually do a get on it while holding mutex. We wait until further validations are completed and we're sure it's the one we want. Race condition is that it could be freed by the time we do the get. Solution is to grab the trigger (iio_trigger_get) as soon as we find it while holding mutex on the list of triggers. If later we decide it's not the right one, put it back. (iio_trigger_put). Signed-off-by: Alison Schofield <amsfield22@gmail.com> Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions