* [PATCH] i2c: mux: gpio: Add missing fwnode_handle_put()
@ 2023-03-22 4:29 Liang He
2023-09-21 9:04 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2023-03-22 4:29 UTC (permalink / raw)
To: peter.korsgaard, peda, linux-i2c, evgreen, windhl
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>
---
drivers/i2c/muxes/i2c-mux-gpio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 73a23e117ebe..0930a51c8c7c 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++;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] i2c: mux: gpio: Add missing fwnode_handle_put()
2023-03-22 4:29 [PATCH] i2c: mux: gpio: Add missing fwnode_handle_put() Liang He
@ 2023-09-21 9:04 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2023-09-21 9:04 UTC (permalink / raw)
To: Liang He; +Cc: peter.korsgaard, peda, linux-i2c, evgreen
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
On Wed, Mar 22, 2023 at 12:29:51PM +0800, Liang He wrote:
> 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>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-21 20:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-22 4:29 [PATCH] i2c: mux: gpio: Add missing fwnode_handle_put() Liang He
2023-09-21 9:04 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox