]> git.itanic.dy.fi Git - linux-stable/commitdiff
media: exynos4-is: fimc-is: Add of_node_put() when breaking out of loop
authorLiang He <windhl@126.com>
Wed, 20 Jul 2022 14:30:03 +0000 (16:30 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 30 Aug 2022 05:27:21 +0000 (07:27 +0200)
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")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/samsung/exynos4-is/fimc-is.c

index e3072d69c49fa797acf358ff8c77e9912568847b..a7704ff069d6c4c7fb2c5936b9f903da2f50d40d 100644 (file)
@@ -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++;