]> git.itanic.dy.fi Git - linux-stable/commitdiff
i2c: mux-gpmux: Add of_node_put() when breaking out of loop
authorLiang He <windhl@126.com>
Fri, 22 Jul 2022 01:24:01 +0000 (09:24 +0800)
committerWolfram Sang <wsa@kernel.org>
Tue, 26 Jul 2022 21:10:59 +0000 (23:10 +0200)
In i2c_mux_probe(), we should call of_node_put() when breaking out
of for_each_child_of_node() which will automatically increase and
decrease the refcount.

Fixes: ac8498f0ce53 ("i2c: i2c-mux-gpmux: new driver")
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/muxes/i2c-mux-gpmux.c

index d3acd8d66c323b2d6589add508eabb9ffad2aa15..33024acaac02b8083751eec245374b79649d0bd4 100644 (file)
@@ -134,6 +134,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
        return 0;
 
 err_children:
+       of_node_put(child);
        i2c_mux_del_adapters(muxc);
 err_parent:
        i2c_put_adapter(parent);