android_kernel_xiaomi_sm8450/drivers/i2c/muxes
Herve Codina 80416f6ba0 i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node()
commit 0fb118de5003028ad092a4e66fc6d07b86c3bc94 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:30:44 +01:00
..
i2c-arb-gpio-challenge.c Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
i2c-demux-pinctrl.c i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 17:30:44 +01:00
i2c-mux-gpio.c Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2019-07-15 21:10:39 -07:00
i2c-mux-gpmux.c i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() 2023-11-08 17:30:43 +01:00
i2c-mux-ltc4306.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
i2c-mux-mlxcpld.c i2c: mux: mlxcpld: simplify code to reach the adapter 2018-10-08 23:44:28 +02:00
i2c-mux-pca954x.c i2c: mux: pca954x: Convert license to SPDX identifier 2020-05-11 21:23:23 +02:00
i2c-mux-pca9541.c i2c: mux: pca9541: use the BIT macro 2020-01-03 15:00:53 +01:00
i2c-mux-pinctrl.c i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node() 2023-11-08 17:30:43 +01:00
i2c-mux-reg.c i2c: mux: reg: check return value after calling platform_get_resource() 2023-01-14 10:16:00 +01:00
Kconfig i2c: Fix Kconfig indentation 2019-11-25 17:13:51 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00