WSL2-Linux-Kernel/drivers/i2c/muxes
Herve Codina 2766a87210 i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node()
commit 0fb118de50 upstream.

i2c-demux-pinctrl uses the pair of_find_i2c_adapter_by_node() /
i2c_put_adapter(). These pair alone is not correct to properly lock the
I2C parent adapter.

Indeed, i2c_put_adapter() decrements the module refcount while
of_find_i2c_adapter_by_node() does not increment it. This leads to an
underflow of the parent module refcount.

Use the	dedicated function, of_get_i2c_adapter_by_node(), to handle
correctly the module refcount.

Fixes: 50a5ba8769 ("i2c: mux: demux-pinctrl: add driver")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Cc: stable@vger.kernel.org
Acked-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-08 17:26:40 +01:00
..
Kconfig
Makefile
i2c-arb-gpio-challenge.c i2c: muxes: i2c-arb-gpio-challenge: Demote non-conformant kernel-doc headers 2021-05-27 21:29:03 +02:00
i2c-demux-pinctrl.c i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 17:26:40 +01:00
i2c-mux-gpio.c i2c: mux: gpio: Add missing fwnode_handle_put() 2023-10-06 13:18:09 +02:00
i2c-mux-gpmux.c i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() 2023-11-08 17:26:40 +01:00
i2c-mux-ltc4306.c
i2c-mux-mlxcpld.c i2c: mux: mlxcpld: Add callback to notify mux creation completion 2021-02-09 11:35:44 +01:00
i2c-mux-pca954x.c
i2c-mux-pca9541.c
i2c-mux-pinctrl.c i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 17:26:40 +01:00
i2c-mux-reg.c i2c: mux: reg: check return value after calling platform_get_resource() 2022-12-31 13:14:31 +01:00