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>] [day] [month] [year] [list]
Message-ID: <20220614062456.56189-1-wupeng58@huawei.com>
Date:   Tue, 14 Jun 2022 06:24:56 +0000
From:   Peng Wu <wupeng58@...wei.com>
To:     <airlied@...ux.ie>, <daniel@...ll.ch>
CC:     <dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
        <liwei391@...wei.com>, <wupeng58@...wei.com>
Subject: [PATCH] drm: logicvc: Add missing of_node_put() in logicvc_drm_config_parse()

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Signed-off-by: Peng Wu <wupeng58@...wei.com>
Reported-by: Hulk Robot <hulkci@...wei.com>
---
 drivers/gpu/drm/logicvc/logicvc_drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
index df1805cf0f95..73d51a8b693e 100644
--- a/drivers/gpu/drm/logicvc/logicvc_drm.c
+++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
@@ -136,8 +136,10 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc)
 	if (!config->layers_count) {
 		drm_err(drm_dev,
 			"Missing a non-optional layers children node\n");
+		of_node_put(layers_node);
 		return -EINVAL;
 	}
+	of_node_put(layers_node);
 
 	return 0;
 }
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ