[3.16.y-ckt stable] Patch "iio: imu: Use iio_trigger_get for indio_dev->trig assignment" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Tue Apr 21 15:23:58 UTC 2015
This is a note to let you know that I have just added a patch titled
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt10.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 3744e086627202094b92498af9ea1b1f43d57d8a Mon Sep 17 00:00:00 2001
From: Darshana Padmadas <darshanapadmadas at gmail.com>
Date: Sat, 28 Mar 2015 12:07:14 +0530
Subject: iio: imu: Use iio_trigger_get for indio_dev->trig assignment
commit 4ce7ca89d6e8eae9e201cd0e972ba323f33e2fb4 upstream.
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 at gmail.com>
Signed-off-by: Jonathan Cameron <jic23 at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/iio/imu/adis_trigger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
More information about the kernel-team
mailing list