lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <be6c204.133.18470aa3e15.Coremail.wangkailong@jari.cn>
Date:   Sun, 13 Nov 2022 19:05:16 +0800 (GMT+08:00)
From:   wangkailong@...i.cn
To:     mchehab@...nel.org, matthias.bgg@...il.com,
        hverkuil-cisco@...all.nl, moudy.ho@...iatek.com, sunke32@...wei.com
Cc:     linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: platform: mtk-mdp3: add missing call to
 of_node_put()

Fix the following coccicheck warning:

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING:
Function "for_each_child_of_node" should have of_node_put() before
return around line 914.
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:892:1-23: WARNING:
Function "for_each_child_of_node" should have of_node_put() before
return around line 920.
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:951:1-23: WARNING:
Function "for_each_child_of_node" should have of_node_put() before
return around line 993.

Signed-off-by: KaiLong Wang <wangkailong@...i.cn>
---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
index d3eaf8884412..4162fc732f38 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
@@ -908,6 +908,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
 		alias_id = mdp_comp_alias_id[type];
 		id = mdp_comp_get_id(type, alias_id);
 		if (id < 0) {
+			of_node_put(node);
 			dev_err(dev,
 				"Fail to get sub comp. id: type %d alias %d\n",
 				type, alias_id);
@@ -916,8 +917,10 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
 		mdp_comp_alias_id[type]++;
 
 		comp = mdp_comp_create(mdp, node, id);
-		if (IS_ERR(comp))
+		if (IS_ERR(comp)) {
+			of_node_put(node);
 			return PTR_ERR(comp);
+		}
 	}
 
 	return 0;
@@ -988,6 +991,7 @@ int mdp_comp_config(struct mdp_dev *mdp)
 
 		pdev = of_find_device_by_node(node);
 		if (!pdev) {
+			of_node_put(node);
 			dev_warn(dev, "can't find platform device of node:%s\n",
 				 node->name);
 			return -ENODEV;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ