]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: c8sectpfe: Add of_node_put() when breaking out of loop
authorLiang He <windhl@126.com>
Tue, 19 Jul 2022 14:10:23 +0000 (22:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:12 +0000 (11:41 +0100)
[ Upstream commit 63ff05a1ad242a5a0f897921c87b70d601bda59c ]

In configure_channels(), we should call of_node_put() when breaking
out of for_each_child_of_node() which will automatically increase
and decrease the refcount.

Fixes: 00760ea9918d ("[media] c8sectpfe: STiH407/10 Linux DVB demux support")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c

index 5baada4f65e5d022bab83de5bacaa48be44fbfdb..69070b70683189a95e04c8e40e96c0958256436c 100644 (file)
@@ -939,6 +939,7 @@ static int configure_channels(struct c8sectpfei *fei)
                if (ret) {
                        dev_err(fei->dev,
                                "configure_memdma_and_inputblock failed\n");
+                       of_node_put(child);
                        goto err_unmap;
                }
                index++;