Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Liu Ying <victor.liu@nxp.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	imx@lists.linux.dev, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	David Airlie <airlied@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Robert Foss <rfoss@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>, Simona Vetter <simona@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/bridge: imx: Use of_node_put(remote) call only once in imx8qxp_pc_bridge_probe()
Date: Mon, 23 Sep 2024 17:04:51 +0800	[thread overview]
Message-ID: <ed3164cd-8a47-4e64-9ee0-60530c12c7a3@nxp.com> (raw)
In-Reply-To: <492f8027-f657-4def-b677-34d3f47d8de4@web.de>

On 09/17/2024, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.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@users.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@nxp.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


      reply	other threads:[~2024-09-23  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17 15:00 [PATCH] drm/bridge: imx: Use of_node_put(remote) call only once in imx8qxp_pc_bridge_probe() Markus Elfring
2024-09-23  9:04 ` Liu Ying [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed3164cd-8a47-4e64-9ee0-60530c12c7a3@nxp.com \
    --to=victor.liu@nxp.com \
    --cc=Markus.Elfring@web.de \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox