OpenCloudOS-Kernel/drivers/i2c/muxes
Herve Codina 3dc0ec46f6 i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node()
i2c-mux-gpmux 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: ac8498f0ce ("i2c: i2c-mux-gpmux: new 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>
2023-10-21 19:57:18 +02:00
..
Kconfig i2c: muxes: pca954x: Add MAX735x/MAX736x support 2023-08-23 23:09:03 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i2c-arb-gpio-challenge.c i2c: Convert to platform remove callback returning void 2023-06-05 09:47:37 +02:00
i2c-demux-pinctrl.c i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-10-21 19:56:55 +02:00
i2c-mux-gpio.c i2c: mux: gpio: Add missing fwnode_handle_put() 2023-09-21 10:48:03 +02:00
i2c-mux-gpmux.c i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() 2023-10-21 19:57:18 +02:00
i2c-mux-ltc4306.c I2C: Explicitly include correct DT includes 2023-08-14 17:47:21 +02:00
i2c-mux-mlxcpld.c i2c: Convert to platform remove callback returning void 2023-06-05 09:47:37 +02:00
i2c-mux-pca954x.c i2c: muxes: pca954x: Add regulator support 2023-08-23 23:09:12 +02:00
i2c-mux-pca9541.c i2c: mux: Convert all drivers to new .probe() callback 2023-03-09 21:59:18 +01:00
i2c-mux-pinctrl.c i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-10-21 19:56:43 +02:00
i2c-mux-reg.c i2c: Convert to platform remove callback returning void 2023-06-05 09:47:37 +02:00