linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Cc: linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Daniel Vetter <daniel@ffwll.ch>,
	David Airlie <airlied@linux.ie>,
	Kevin Hilman <khilman@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Yi Wang <wang.yi59@zte.com.cn>
Subject: Re: [PATCH 2/7] drm/meson: fix possible object reference leak
Date: Thu, 4 Apr 2019 22:05:41 +0200	[thread overview]
Message-ID: <07090eca-640f-830c-7e55-22a486cd0002@web.de> (raw)
In-Reply-To: <1554307455-40361-3-git-send-email-wen.yang99@zte.com.cn>

> @@ -720,13 +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;
> -	}
> -
>  	of_node_put(ep);
>  	of_node_put(remote);

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/meson/meson_dw_hdmi.c?id=61de49cb596710b918f7a80839f0b6de2017bc32#n712

Can the order of these put calls matter (because of processor caches)?


> +	if (remote)
> +		return true;
>
>  	return false;

Would the use of a ternary operator be more succinct here?

+	return remote ? true : false;

Regards,
Markus

  reply	other threads:[~2019-04-04 20:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 16:04 [PATCH 0/7] fix possible object reference leaks in drivers/gpu Wen Yang
2019-04-03 16:04 ` [PATCH 1/7] drm/mediatek: fix possible object reference leak Wen Yang
2019-04-09  5:15   ` CK Hu
2019-04-03 16:04 ` [PATCH 2/7] drm/meson: " Wen Yang
2019-04-04 20:05   ` Markus Elfring [this message]
2019-04-03 16:04 ` [PATCH 3/7] drm/msm: a5xx: " Wen Yang
2019-04-10 16:21   ` Jordan Crouse
2019-04-03 16:04 ` [PATCH 4/7] drm/omap: " Wen Yang
2019-04-04 13:25   ` Laurent Pinchart
2019-04-04 20:42   ` Markus Elfring
2019-04-03 16:04 ` [PATCH 5/7] drm/pl111: " Wen Yang
2019-04-04 19:59   ` Eric Anholt
2019-04-04 21:05   ` Markus Elfring
2019-04-03 16:04 ` [PATCH 6/7] drm: rcar-du: " Wen Yang
2019-04-04 13:35   ` Laurent Pinchart
2019-04-03 16:04 ` [PATCH 7/7] drm/tegra: " Wen Yang

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=07090eca-640f-830c-7e55-22a486cd0002@web.de \
    --to=markus.elfring@web.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).