Skip to content

Commit

Permalink
i2c: mux: gpio: Add missing fwnode_handle_put()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liang He authored and Wolfram Sang committed Sep 21, 2023
1 parent 7c0195f commit db6aee6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/i2c/muxes/i2c-mux-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit db6aee6

Please sign in to comment.