diff options
author | Matthias Brugger <matthias.bgg@gmail.com> | 2019-06-21 13:32:50 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-13 16:42:45 +0200 |
commit | 864919ea0380e62adb2503b89825fe358acb8216 (patch) | |
tree | 1431a469e725ee26ba92c5c962da240590b52bb0 | |
parent | media: cedrus: Don't set chroma size for scale & rotation (diff) | |
download | linux-864919ea0380e62adb2503b89825fe358acb8216.tar.xz linux-864919ea0380e62adb2503b89825fe358acb8216.zip |
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: ba1f1f70c2c0 ("[media] media: mtk-mdp: Fix mdp device tree")
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Houlong Wei <houlong.wei@mediatek.com>
[hverkuil-cisco@xs4all.nl: use node instead of parent as temp variable]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index fc9faec85edb..5d44f2e92dd5 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -110,7 +110,9 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(&mdp->vpulock); /* 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; dev_warn(dev, "device tree is out of date\n"); } else { |