Skip to content

Commit db6aee6

Browse files
windhlwsakernel
authored andcommitted
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: 98b2b71 ("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>
1 parent 7c0195f commit db6aee6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/i2c/muxes/i2c-mux-gpio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ static int i2c_mux_gpio_probe_fw(struct gpiomux *mux,
105105

106106
} else if (is_acpi_node(child)) {
107107
rc = acpi_get_local_address(ACPI_HANDLE_FWNODE(child), values + i);
108-
if (rc)
108+
if (rc) {
109+
fwnode_handle_put(child);
109110
return dev_err_probe(dev, rc, "Cannot get address\n");
111+
}
110112
}
111113

112114
i++;

0 commit comments

Comments
 (0)