summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2014-08-22 20:48:00 (GMT)
committerJonathan Cameron <jic23@kernel.org>2014-08-25 20:48:39 (GMT)
commit55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e (patch)
treebc8b00b9d92a6850f8fefb2a4fad68772653a7d1 /drivers/iio
parent9e5846be33277802c0c76e5c12825d0e4d27f639 (diff)
downloadlinux-55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e.tar.xz
iio: hid_sensor_hub: Fix indio_dev->trig assignment
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> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Cc: Stable@vger.kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/common/hid-sensors/hid-sensor-trigger.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index a3109a6..92068cd 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -122,7 +122,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
dev_err(&indio_dev->dev, "Trigger Register Failed\n");
goto error_free_trig;
}
- indio_dev->trig = attrb->trigger = trig;
+ attrb->trigger = trig;
+ indio_dev->trig = iio_trigger_get(trig);
return ret;