aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorDarshana Padmadas <darshanapadmadas@gmail.com>2015-03-28 12:07:14 +0530
committerSasha Levin <sasha.levin@oracle.com>2015-04-24 17:13:53 -0400
commitcfb769a843e50fd6d930a6655cdf2afd9bc0b0ab (patch)
tree79720f9f38b62bf2626753d4536b6060a922b84b /drivers/iio
parentdcf72cd6133cd00f2cbdaf97a535187c222745c1 (diff)
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
[ Upstream commit 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 ] This patch uses iio_trigger_get to increment the reference count of trigger device, to avoid incorrect assignment. Can result in a null pointer dereference during removal if the trigger has been changed before removal. This patch refers to a similar situation encountered through the following discussion: http://www.spinics.net/lists/linux-iio/msg13669.html Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/adis_trigger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c
index e0017c22bb9c..f53e9a803a0e 100644
--- a/drivers/iio/imu/adis_trigger.c
+++ b/drivers/iio/imu/adis_trigger.c
@@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
iio_trigger_set_drvdata(adis->trig, adis);
ret = iio_trigger_register(adis->trig);
- indio_dev->trig = adis->trig;
+ indio_dev->trig = iio_trigger_get(adis->trig);
if (ret)
goto error_free_irq;