WSL2-Linux-Kernel/drivers/iio/humidity
Dmitry Rokosov 974e69beeb iio:humidity:hts221: rearrange iio trigger get and register
commit 10b9c2c33a 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: e4a70e3e7d ("iio: humidity: add support to hts221 rh/temp combo device")
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220524181150.9240-6-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 09:03:27 +02:00
..
Kconfig
Makefile
am2315.c
dht11.c
hdc100x.c
hdc2010.c
hid-sensor-humidity.c
hts221.h
hts221_buffer.c
hts221_core.c
hts221_i2c.c
hts221_spi.c
htu21.c
si7005.c
si7020.c