linux-stable/drivers/iio/chemical
Dmitry Rokosov f26379e199 iio:chemical:ccs811: rearrange iio trigger get and register
commit d710359c0b upstream.

IIO trigger interface function iio_trigger_get() should be called after
iio_trigger_register() (or its devm analogue) strictly, because of
iio_trigger_get() acquires module refcnt based on the trigger->owner
pointer, which is initialized inside iio_trigger_register() to
THIS_MODULE.
If this call order is wrong, the next iio_trigger_put() (from sysfs
callback or "delete module" path) will dereference "default" module
refcnt, which is incorrect behaviour.

Fixes: f1f065d7ac ("iio: chemical: ccs811: Add support for data ready trigger")
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220524181150.9240-5-ddrokosov@sberdevices.ru
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-29 08:59:51 +02:00
..
ams-iaq-core.c
atlas-ezo-sensor.c
atlas-sensor.c
bme680.h
bme680_core.c
bme680_i2c.c
bme680_spi.c
ccs811.c
Kconfig
Makefile
pms7003.c
scd30.h
scd30_core.c
scd30_i2c.c
scd30_serial.c
sgp30.c
sps30.c
vz89x.c