summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2014-08-23 00:48:00 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-06 01:54:11 +0400
commite3675a4bd5f72e2551a4f4dfae7330c8b6c854dd (patch)
tree5540094b335998670a62322dcb771facd669ff89
parentcde9b0d1ec4f85fa3602a158c2e3ee5e6d6b925d (diff)
downloadlinux-e3675a4bd5f72e2551a4f4dfae7330c8b6c854dd.tar.xz
iio: meter: ade7758: Fix indio_dev->trig assignment
commit 0495081179212b758775df752e657ea71dcae020 upstream. This can result in wrong reference count for trigger device, call iio_trigger_get to increment reference. Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion with Jonathan. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/iio/meter/ade7758_trigger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c
index 7a94ddd42f59..8c4f2896cd0d 100644
--- a/drivers/staging/iio/meter/ade7758_trigger.c
+++ b/drivers/staging/iio/meter/ade7758_trigger.c
@@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev)
ret = iio_trigger_register(st->trig);
/* select default trigger */
- indio_dev->trig = st->trig;
+ indio_dev->trig = iio_trigger_get(st->trig);
if (ret)
goto error_free_irq;