All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Mark Mentovai <mark@moxienet.com>
Subject: Re: [net-next PATCH 2/2] net: ethernet: stmmac: reset force speed bit for ipq806x
Date: Mon, 13 Jun 2022 22:49:17 -0700	[thread overview]
Message-ID: <20220613224917.325aca0a@kernel.org> (raw)
In-Reply-To: <20220609002831.24236-2-ansuelsmth@gmail.com>

On Thu,  9 Jun 2022 02:28:31 +0200 Christian 'Ansuel' Marangi wrote:
> +	dn = of_get_child_by_name(pdev->dev.of_node, "fixed-link");
> +	ret = of_property_read_u32(dn, "speed", &link_speed);
> +	if (ret) {
> +		dev_err(dev, "found fixed-link node with no speed");
> +		return ret;

Doesn't this return potentially leak the reference on dn?
You move the of_node_put() right before the if (ret) {

> +	}
> +
> +	of_node_put(dn);

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Jakub Kicinski <kuba@kernel.org>
To: Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Mark Mentovai <mark@moxienet.com>
Subject: Re: [net-next PATCH 2/2] net: ethernet: stmmac: reset force speed bit for ipq806x
Date: Mon, 13 Jun 2022 22:49:17 -0700	[thread overview]
Message-ID: <20220613224917.325aca0a@kernel.org> (raw)
In-Reply-To: <20220609002831.24236-2-ansuelsmth@gmail.com>

On Thu,  9 Jun 2022 02:28:31 +0200 Christian 'Ansuel' Marangi wrote:
> +	dn = of_get_child_by_name(pdev->dev.of_node, "fixed-link");
> +	ret = of_property_read_u32(dn, "speed", &link_speed);
> +	if (ret) {
> +		dev_err(dev, "found fixed-link node with no speed");
> +		return ret;

Doesn't this return potentially leak the reference on dn?
You move the of_node_put() right before the if (ret) {

> +	}
> +
> +	of_node_put(dn);

  reply	other threads:[~2022-06-14  5:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  0:28 [net-next PATCH 1/2] net: ethernet: stmmac: add missing sgmii configure for ipq806x Christian 'Ansuel' Marangi
2022-06-09  0:28 ` Christian 'Ansuel' Marangi
2022-06-09  0:28 ` [net-next PATCH 2/2] net: ethernet: stmmac: reset force speed bit " Christian 'Ansuel' Marangi
2022-06-09  0:28   ` Christian 'Ansuel' Marangi
2022-06-14  5:49   ` Jakub Kicinski [this message]
2022-06-14  5:49     ` Jakub Kicinski
2022-06-14 10:40     ` Ansuel Smith
2022-06-14 10:40       ` Ansuel Smith

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=20220613224917.325aca0a@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mark@moxienet.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.