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-prev] [day] [month] [year] [list]
Message-ID: <ed3164cd-8a47-4e64-9ee0-60530c12c7a3@nxp.com>
Date: Mon, 23 Sep 2024 17:04:51 +0800
From: Liu Ying <victor.liu@....com>
To: Markus Elfring <Markus.Elfring@....de>, 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>,
 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: Re: [PATCH] drm/bridge: imx: Use of_node_put(remote) call only once
 in imx8qxp_pc_bridge_probe()

On 09/17/2024, Markus Elfring wrote:
> 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(-)

The patch subject should be something like

drm/bridge: imx8qxp-pixel-combiner: Call of_node_put(remote) only once in probe function

so that the prefixes may tell the driver the patch touches,
just like some other previous patches did for this driver
shown by 'git log'.

Not sure if it is worth a v2 just for that.
Maybe, a patch committer can fix it before pushing.

With the patch subject fixed:
Reviewed-by: Liu Ying <victor.liu@....com>

> 
> 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
> 

-- 
Regards,
Liu Ying


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ