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]
Date:   Mon, 8 Apr 2019 10:58:31 +0800
From:   Wen Yang <>
Cc:, Wen Yang <>,
        Neil Armstrong <>,
        David Airlie <>,
        Daniel Vetter <>,
        Kevin Hilman <>,,,,
        Markus Elfring <>
Subject: [PATCH v2] drm/meson: fix possible object reference leak

The call to of_graph_get_remote_port returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last

Detected by coccinelle with the following warnings:
drivers/gpu/drm/meson/meson_dw_hdmi.c:725:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 722, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <>
Cc: Neil Armstrong <>
Cc: David Airlie <>
Cc: Daniel Vetter <>
Cc: Kevin Hilman <>
Cc: Markus Elfring <>
v2->v1: convert a if statement into a ternary statement.

 drivers/gpu/drm/meson/meson_dw_hdmi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index 563953e..826b98b 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -720,15 +720,10 @@ static bool meson_hdmi_connector_is_available(struct device *dev)
 	/* If the endpoint node exists, consider it enabled */
 	remote = of_graph_get_remote_port(ep);
-	if (remote) {
-		of_node_put(ep);
-		return true;
-	}
-	return false;
+	return remote ? true : false;
 static int meson_dw_hdmi_bind(struct device *dev, struct device *master,

Powered by blists - more mailing lists