Skip to content

Commit 4ce7ca8

Browse files
darshanapdasjic23
authored andcommitted
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
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>
1 parent f54e9f2 commit 4ce7ca8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/iio/imu/adis_trigger.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev)
6060
iio_trigger_set_drvdata(adis->trig, adis);
6161
ret = iio_trigger_register(adis->trig);
6262

63-
indio_dev->trig = adis->trig;
63+
indio_dev->trig = iio_trigger_get(adis->trig);
6464
if (ret)
6565
goto error_free_irq;
6666

0 commit comments

Comments
 (0)