[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <492f8027-f657-4def-b677-34d3f47d8de4@web.de>
Date: Tue, 17 Sep 2024 17:00:31 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: imx@...ts.linux.dev, dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, kernel@...gutronix.de,
Andrzej Hajda <andrzej.hajda@...el.com>, David Airlie <airlied@...il.com>,
Fabio Estevam <festevam@...il.com>, Jernej Skrabec
<jernej.skrabec@...il.com>, Jonas Karlman <jonas@...boo.se>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Liu Ying <victor.liu@....com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>,
Simona Vetter <simona@...ll.ch>, Thomas Zimmermann <tzimmermann@...e.de>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] drm/bridge: imx: Use of_node_put(remote) call only once in
imx8qxp_pc_bridge_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 17 Sep 2024 16:40:18 +0200
A of_node_put(remote) call was immediately used after a null pointer check
for the data structure member “next_bridge” in this
function implementation.
Thus use such a function call only once instead directly before the check.
This issue was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
index e6dbbdc87ce2..0064d37ad8f6 100644
--- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
+++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c
@@ -321,8 +321,8 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev)
}
ch->next_bridge = of_drm_find_bridge(remote);
+ of_node_put(remote);
if (!ch->next_bridge) {
- of_node_put(remote);
ret = -EPROBE_DEFER;
DRM_DEV_DEBUG_DRIVER(dev,
"channel%u failed to find next bridge: %d\n",
@@ -330,8 +330,6 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev)
goto free_child;
}
- of_node_put(remote);
-
ch->bridge.driver_private = ch;
ch->bridge.funcs = &imx8qxp_pc_bridge_funcs;
ch->bridge.of_node = child;
--
2.46.0
Powered by blists - more mailing lists