linux/drivers/iio/trigger
Alison Schofield 19d0541bd2 iio: trigger: free trigger resource correctly
[ Upstream commit 10e840dfb0 ]

These stand-alone trigger drivers were using iio_trigger_put()
where they should have been using iio_trigger_free().  The
iio_trigger_put() adds a module_put which is bad since they
never did a module_get.

In the sysfs driver, module_get/put's are used as triggers are
added & removed. This extra module_put() occurs on an error path
in the probe routine (probably rare).

In the bfin-timer & interrupt trigger drivers, the module resources
are not explicitly managed, so it's doing a put on something that
was never get'd.  It occurs on the probe error path and on the
remove path (not so rare).

Tested with the sysfs trigger driver.
The bfin & interrupt drivers were build tested & inspected only.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-11-15 15:53:14 +01:00
..
iio-trig-hrtimer.c iio: trigger: Introduce IIO hrtimer based trigger 2015-12-03 18:19:27 +00:00
iio-trig-interrupt.c iio: trigger: free trigger resource correctly 2017-11-15 15:53:14 +01:00
iio-trig-loop.c iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00
iio-trig-sysfs.c iio: trigger: free trigger resource correctly 2017-11-15 15:53:14 +01:00
Kconfig iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00
Makefile iio:trigger: Experimental kthread tight loop trigger (thread only) 2016-06-03 13:18:44 +01:00