]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: imu: Use iio_trigger_get for indio_dev->trig assignment
authorDarshana Padmadas <darshanapadmadas@gmail.com>
Sat, 28 Mar 2015 06:37:14 +0000 (12:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Apr 2015 08:10:20 +0000 (10:10 +0200)
commit7f754cc8edfb11d255eb91c823f93aa09ef0f138
tree57a4bf3886b2379c19c6edf210f18afcfcfd3de2
parentecc682b240970786149559f50dac4613e374192d
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@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/adis_trigger.c