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: <20230530094541.23396-1-luhongfei@vivo.com>
Date:   Tue, 30 May 2023 17:45:34 +0800
From:   Lu Hongfei <luhongfei@...o.com>
To:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Moudy Ho <moudy.ho@...iatek.com>,
        Ping-Hsun Wu <ping-hsun.wu@...iatek.com>,
        Arnd Bergmann <arnd@...db.de>, Lu Hongfei <luhongfei@...o.com>,
        Sun Ke <sunke32@...wei.com>,
        linux-media@...r.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE
        (V4L/DVB)),
        linux-kernel@...r.kernel.org (open list:ARM/Mediatek SoC support),
        linux-arm-kernel@...ts.infradead.org (moderated list:ARM/Mediatek SoC
        support),
        linux-mediatek@...ts.infradead.org (moderated list:ARM/Mediatek SoC
        support)
Cc:     opensource.kernel@...o.com
Subject: [PATCH] media: Fix resource leaks in for_each_child_of_node() loops

for_each_child_of_node should have of_node_put() avoid resource leaks.

Signed-off-by: Lu Hongfei <luhongfei@...o.com>
---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 3 +++
 1 file changed, 3 insertions(+)
 mode change 100644 => 100755 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
index 19a4a085f73a..5a6a61d68cba
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
@@ -1128,6 +1128,7 @@ int mdp_comp_config(struct mdp_dev *mdp)
 		comp = mdp_comp_create(mdp, node, id);
 		if (IS_ERR(comp)) {
 			ret = PTR_ERR(comp);
+			of_node_put(node);
 			goto err_init_comps;
 		}
 
@@ -1137,6 +1138,8 @@ int mdp_comp_config(struct mdp_dev *mdp)
 		pm_runtime_enable(comp->comp_dev);
 	}
 
+	of_node_put(node);
+
 	ret = mdp_comp_sub_create(mdp);
 	if (ret)
 		goto err_init_comps;
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ