]> git.baikalelectronics.ru Git - kernel.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:36 +0000 (13:22 +0200)
[ Upstream commit 9466fcd153f8b89cbaa967af56bcc57140044b8d ]

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: a890fd16ba36 ("[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/exynos4-is/fimc-is.c

index 9bb14bb2e4987681f53caa8ddb198c626c2009c7..c78c2a7f03fa69b69670b79cf1e14d3c733687c6 100644 (file)
@@ -214,6 +214,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++;