Commit 864919ea authored by Matthias Brugger's avatar Matthias Brugger Committed by Mauro Carvalho Chehab

media: mtk-mdp: fix reference count on old device tree

of_get_next_child() increments the reference count of the returning
device_node. Decrement it in the check if we are using the old or the
new DTB.

Fixes: ba1f1f70 ("[media] media: mtk-mdp: Fix mdp device tree")
Signed-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Acked-by: default avatarHoulong Wei <houlong.wei@mediatek.com>
[hverkuil-cisco@xs4all.nl: use node instead of parent as temp variable]
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent b557b507
...@@ -110,7 +110,9 @@ static int mtk_mdp_probe(struct platform_device *pdev) ...@@ -110,7 +110,9 @@ static int mtk_mdp_probe(struct platform_device *pdev)
mutex_init(&mdp->vpulock); mutex_init(&mdp->vpulock);
/* Old dts had the components as child nodes */ /* Old dts had the components as child nodes */
if (of_get_next_child(dev->of_node, NULL)) { node = of_get_next_child(dev->of_node, NULL);
if (node) {
of_node_put(node);
parent = dev->of_node; parent = dev->of_node;
dev_warn(dev, "device tree is out of date\n"); dev_warn(dev, "device tree is out of date\n");
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment