Skip to contentSkip to conversation

i2c: mux: gpio: Add missing fwnode_handle_put()

PATCH Applied Liang He 2 participants 2 messages Mar 22, 2023 – Sep 21, 2023

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/i2c/muxes/i2c-mux-gpio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/muxes/i2c-mux-gpio.c +3 -1
index 73a23e117ebe..0930a51c8c7c 100644
@@ -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++;
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 6 lines · Liang He

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")

Applied to for-current, thanks!