Skip to contentSkip to conversation

media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop

PATCH New Liang He 1 participant 1 message Jul 20, 2022

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop

In fimc_is_register_subdevs(), we need to call of_node_put() for the reference 'i2c_bus' when breaking out of the for_each_compatible_node() which has increased the refcount.

Fixes 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")

---
while commit-9a761e436843 is not the one using current nested
for_each_*, it also did not calll of_node_put() when breaking out of loop for the out_side for_each_*.

 drivers/media/platform/samsung/exynos4-is/fimc-is.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/samsung/exynos4-is/fimc-is.c +1 -0
index e3072d69c49f..a7704ff069d6 100644
@@ -213,6 +213,7 @@ static int fimc_is_register_subdevs(struct fimc_is *is)
 
 			if (ret < 0 || index >= FIMC_IS_SENSORS_NUM) {
 				of_node_put(child);
+				of_node_put(i2c_bus);
 				return ret;
 			}
 			index++;
Signature · 1 line
2.25.1