summaryrefslogtreecommitdiffstats
path: root/drivers/iio/trigger/iio-trig-sysfs.c
diff options
context:
space:
mode:
authorAlison Schofield <amsfield22@gmail.com>2017-01-20 04:47:38 +0100
committerJonathan Cameron <jic23@kernel.org>2017-01-22 17:14:21 +0100
commit10e840dfb0b7fc345082dd9e5fff3c1c02e7690e (patch)
treef7aeb78e9558b7d18a852970b59c85f9ab0c5555 /drivers/iio/trigger/iio-trig-sysfs.c
parentiio: trigger: clean up viio_trigger_alloc() (diff)
downloadlinux-10e840dfb0b7fc345082dd9e5fff3c1c02e7690e.tar.xz
linux-10e840dfb0b7fc345082dd9e5fff3c1c02e7690e.zip
iio: trigger: free trigger resource correctly
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>
Diffstat (limited to 'drivers/iio/trigger/iio-trig-sysfs.c')
-rw-r--r--drivers/iio/trigger/iio-trig-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
index 3dfab2bc6d69..202e8b89caf2 100644
--- a/drivers/iio/trigger/iio-trig-sysfs.c
+++ b/drivers/iio/trigger/iio-trig-sysfs.c
@@ -174,7 +174,7 @@ static int iio_sysfs_trigger_probe(int id)
return 0;
out2:
- iio_trigger_put(t->trig);
+ iio_trigger_free(t->trig);
free_t:
kfree(t);
out1: