[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220506125548.7ccdba25@kernel.org>
Date: Fri, 6 May 2022 12:55:48 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<ioana.ciornei@....com>, <davem@...emloft.net>,
<robert-ionut.alexa@....com>
Subject: Re: [PATCH v2] net: dpaa2-mac: add missing of_node_put() in
dpaa2_mac_get_node()
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@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.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;
Powered by blists - more mailing lists