[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230602235254.61798d80@kernel.org>
Date: Fri, 2 Jun 2023 23:52:54 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Justin Chen <justin.chen@...adcom.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com, florian.fainelli@...adcom.com,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
opendmb@...il.com, andrew@...n.ch, hkallweit1@...il.com,
linux@...linux.org.uk, richardcochran@...il.com, sumit.semwal@...aro.org,
christian.koenig@....com, simon.horman@...igine.com
Subject: Re: [PATCH net-next v6 3/6] net: bcmasp: Add support for ASP2.0
Ethernet controller
On Thu, 1 Jun 2023 15:12:28 -0700 Justin Chen wrote:
> + ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports");
> + if (!ports_node) {
> + dev_warn(dev, "No ports found\n");
> + return 0;
> + }
> +
> + for_each_available_child_of_node(ports_node, intf_node) {
> + of_property_read_u32(intf_node, "reg", &port);
> + if (!bcmasp_is_port_valid(priv, port)) {
> + dev_warn(dev, "%pOF: %d is an invalid port\n",
> + intf_node, port);
> + continue;
> + }
> +
> + priv->intf_count++;
> + }
I think that you're leaking ports_node,
/**
* of_find_node_by_name - Find a node by its "name" property
* @from: The node to start searching from or NULL; the node
* you pass will not be searched, only the next one
* will. Typically, you pass what the previous call
* returned. of_node_put() will be called on @from.
* @name: The name string to match against
*
* Return: A node pointer with refcount incremented, use
* of_node_put() on it when done.
*/
--
pw-bot: cr
Powered by blists - more mailing lists