From: Liang He Date: Fri, 22 Jul 2022 01:24:01 +0000 (+0800) Subject: i2c: mux-gpmux: Add of_node_put() when breaking out of loop X-Git-Tag: v4.19.256~181 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a06af2a004fdf05b7e1bf1b4f6d4490e6134c121;p=thirdparty%2Fkernel%2Fstable.git i2c: mux-gpmux: Add of_node_put() when breaking out of loop [ Upstream commit 6435319c34704994e19b0767f6a4e6f37439867b ] 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 Acked-by: Peter Rosin Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c index 92cf5f48afe63..5053f1675a294 100644 --- a/drivers/i2c/muxes/i2c-mux-gpmux.c +++ b/drivers/i2c/muxes/i2c-mux-gpmux.c @@ -141,6 +141,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);