linux-stable/drivers/iio/chemical
Dmitry Rokosov 8ea16a64aa 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:58:47 +02:00
..
Kconfig
Makefile
ams-iaq-core.c
atlas-ph-sensor.c
bme680.h
bme680_core.c
bme680_i2c.c
bme680_spi.c
ccs811.c iio:chemical:ccs811: rearrange iio trigger get and register 2022-06-29 08:58:47 +02:00
pms7003.c iio:chemical:pms7003: Fix timestamp alignment and prevent data leak. 2020-06-10 20:24:56 +02:00
sgp30.c
sps30.c iio:chemical:sps30: Fix timestamp alignment 2020-06-10 20:24:56 +02:00
vz89x.c