diff options
| author | 2022-05-24 18:14:45 +0000 | |
|---|---|---|
| committer | 2022-06-19 17:22:49 +0100 | |
| commit | d710359c0b445e8c03e24f19ae2fb79ce7282260 (patch) | |
| tree | cb3f0d69cd0dc5ca562a828e96d32d33e8893542 /tools/scripts/ssh:/git@git.zx2c4.com/git: | |
| parent | iio:accel:mxc4005: rearrange iio trigger get and register (diff) | |
| download | linux-dev-d710359c0b445e8c03e24f19ae2fb79ce7282260.tar.xz linux-dev-d710359c0b445e8c03e24f19ae2fb79ce7282260.zip | |
iio:chemical:ccs811: rearrange iio trigger get and register
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: f1f065d7ac30 ("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>
Diffstat (limited to 'tools/scripts/ssh:/git@git.zx2c4.com/git:')
0 files changed, 0 insertions, 0 deletions
