From: Jakub Kicinski <kuba@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<ioana.ciornei@nxp.com>, <davem@davemloft.net>,
<robert-ionut.alexa@nxp.com>
Subject: Re: [PATCH v2] net: dpaa2-mac: add missing of_node_put() in dpaa2_mac_get_node()
Date: Fri, 6 May 2022 12:55:48 -0700 [thread overview]
Message-ID: <20220506125548.7ccdba25@kernel.org> (raw)
In-Reply-To: <20220505021833.3864434-1-yangyingliang@huawei.com>
On Thu, 5 May 2022 10:18:33 +0800 Yang Yingliang wrote:
> Add missing of_node_put() in error path in dpaa2_mac_get_node().
>
> Fixes: 5b1e38c0792c ("dpaa2-mac: bail if the dpmacs fwnode is not found")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> index c48811d3bcd5..fab2ce6bee9f 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
> @@ -108,8 +108,10 @@ static struct fwnode_handle *dpaa2_mac_get_node(struct device *dev,
> return ERR_PTR(-EPROBE_DEFER);
> }
>
> - if (!parent)
> + if (!parent) {
> + of_node_put(dpmacs);
I don't see how !parent && dpmacs can ever be true.
> return NULL;
> + }
>
> fwnode_for_each_child_node(parent, child) {
> err = -EINVAL;
prev parent reply other threads:[~2022-05-06 19:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 2:18 [PATCH v2] net: dpaa2-mac: add missing of_node_put() in dpaa2_mac_get_node() Yang Yingliang
2022-05-06 19:55 ` Jakub Kicinski [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=20220506125548.7ccdba25@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=ioana.ciornei@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robert-ionut.alexa@nxp.com \
--cc=yangyingliang@huawei.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.