]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: Fix error handling in iio_trigger_attach_poll_func
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Tue, 3 May 2016 12:27:09 +0000 (15:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 15:42:20 +0000 (08:42 -0700)
commitc2b621ce19615cbf5441f4ddc30f7e29dc183ca3
treeb2e16271f32e9db5c09df9d3447e7fb2c7ef739e
parent78b32b54518a86da0f42542953ff2827b10868a6
iio: Fix error handling in iio_trigger_attach_poll_func

commit 99543823357966ac938d9a310947e731b67338e6 upstream.

When attaching a pollfunc iio_trigger_attach_poll_func will allocate a
virtual irq and call the driver's set_trigger_state function. Fix error
handling to undo previous steps if any fails.

In particular this fixes handling errors from a driver's
set_trigger_state function. When using triggered buffers a failure to
enable the trigger used to make the buffer unusable.

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-trigger.c