diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2014-08-22 22:48:00 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-08-25 22:48:39 +0200 |
commit | 55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e (patch) | |
tree | bc8b00b9d92a6850f8fefb2a4fad68772653a7d1 /drivers/iio | |
parent | iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment (diff) | |
download | linux-55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e.tar.xz linux-55a6f9ddfdea0d2d343cd1b39baf8aa752664b6e.zip |
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.c | 3 |
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 a3109a6f4d86..92068cdbf8c7 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; |