aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2023-03-22 12:29:51 +0800
committerWolfram Sang <wsa@kernel.org>2023-09-21 10:48:03 +0200
commitdb6aee6083a56ac4a6cd1b08fff7938072bcd0a3 (patch)
tree0b60b098236fb20f8d8fc903a5635464ca399804 /drivers/i2c
parent7c0195fa9a9e263df204963f88a22b21688ffb66 (diff)
downloadlinux-db6aee6083a56ac4a6cd1b08fff7938072bcd0a3.tar.gz
i2c: mux: gpio: Add missing fwnode_handle_put()
In i2c_mux_gpio_probe_fw(), we should add fwnode_handle_put() when break out of the iteration device_for_each_child_node() as it will automatically increase and decrease the refcounter. Fixes: 98b2b712bc85 ("i2c: i2c-mux-gpio: Enable this driver in ACPI land") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/muxes/i2c-mux-gpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 5d5cbe0130cdf9..5ca03bd34c8d11 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -105,8 +105,10 @@ static int i2c_mux_gpio_probe_fw(struct gpiomux *mux,
} else if (is_acpi_node(child)) {
rc = acpi_get_local_address(ACPI_HANDLE_FWNODE(child), values + i);
- if (rc)
+ if (rc) {
+ fwnode_handle_put(child);
return dev_err_probe(dev, rc, "Cannot get address\n");
+ }
}
i++;