[PATCH] i2c: i2c-mux-gpmux: Add of_node_put() when breaking out of loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 drivers/i2c/muxes/i2c-mux-gpmux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/muxes/i2c-mux-gpmux.c b/drivers/i2c/muxes/i2c-mux-gpmux.c
index d3acd8d66c32..30ab2fe88c8d 100644
--- a/drivers/i2c/muxes/i2c-mux-gpmux.c
+++ b/drivers/i2c/muxes/i2c-mux-gpmux.c
@@ -115,6 +115,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
 		if (ret < 0) {
 			dev_err(dev, "no reg property for node '%pOFn'\n",
 				child);
+			of_node_put(child);
 			goto err_children;
 		}
 
-- 
2.25.1




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux