Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3186304rwd; Sat, 3 Jun 2023 00:02:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7QsUU3auYzpTlTxq9F5ec5wkS+7B0L2oifWCEYYhwkY+PoZXtR6cg5S5zCP9HGORran8f7 X-Received: by 2002:a05:622a:210:b0:3f6:bd82:c015 with SMTP id b16-20020a05622a021000b003f6bd82c015mr1315130qtx.6.1685775770333; Sat, 03 Jun 2023 00:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685775770; cv=none; d=google.com; s=arc-20160816; b=Bnf6HBSG5gq1cOXUllfczigO/dRjwNmGj61DnHP6pJOkP+Z2v5YorXLAFstK/Wz5VO ZUFmRVLf40zeSvvU25eQQjOLJ2OYyPy7S8/QLBtNV1HgRPyc9rApIoPBCyix5wYeeWJN k6RWT002SkeREwfKPkIjNl80Q5TMGvnNbjsgGlRuX8scXxNaCTg5ufsc0uasOUqlg8/k pjcVVL3sWND5XxjqdXvTZGlm/fhp749f0gYYDJ0vRM6T6H9/u2yvwLInbThodErcKU9N m4pnt8c6SSYIyaFfJDi653N2YqmB70GJGdoYo0XuzfoIVMYK8kzgtuZOnMtYe9DBKvzN SiDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=cp3/s4K3PQPAxtN1fs7VsabQXdW7T35YaTYDy+gIrmM=; b=fph3ulvuFWdOr1QhjZ6Po8MATgGTYnMkmYE4ns1AbXqtUTogFbI0S2NCq/1d7Ihuoy yEJXoPklMERaig4QSHa00jAmSNXZN5MDHIlFEHKOuIfzTNORsvv3nZ8b5pNEutSlgTW+ 6F32jG1ZdCiipSnfFU3rtGB6xv6Ac83bY1wWf9OYynmpKzFuNLPm6iIY+rpDsbd4ncRi TTN+EZ4hTpwmrM0caMAxBEN7r4D6mwSMHCdKYD/k2ErmtmFPocpAuMgcSVIzAJjTk1Jz DKyHra5ZzCLRruhYoXucZWTEIA1/cpTvZJn96HqzzYJNXBry0O+hPln647U/LyJ6U7/x QEqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TE06WsU3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170902ea9400b0019e88376e3csi2099453plb.162.2023.06.03.00.02.38; Sat, 03 Jun 2023 00:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TE06WsU3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232051AbjFCGw7 (ORCPT + 99 others); Sat, 3 Jun 2023 02:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjFCGw6 (ORCPT ); Sat, 3 Jun 2023 02:52:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7180197; Fri, 2 Jun 2023 23:52:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 39149601D9; Sat, 3 Jun 2023 06:52:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7248C433D2; Sat, 3 Jun 2023 06:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685775176; bh=Dtp7yfw3yIgpqLiDkFokEpEEdCuCwpELzyb1JLQqmrw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TE06WsU3DCFbMrsqZlqF429AXurYRJfP/0Zv2ohSLs8375orVlB58ve3KTVMOKmbS PiSGZynui9JnJg3B0/YZWpIZNRBhfGEOFp5rVJeK0fJRGDREg6nyecUN+4NutKmEQn tWlwAcdAaynyHoVkcXLssxpGSI5ieYElOSfvkBonjBHaFxvZbisr8nwO2ZFMk+7oMs IfxML+cV2NVqDTx8M9FPI+0b+YW1dc3EemFN7SKx7Npi+s7qViK6ohzl9PT3FJneS4 JB5fK5J42HHHgWuz4xmEC9Rh2kZXRiWuUndyPJqFmZ9i9kDnfl54QUS0S+KfKmOB+d eVh/BEjikHwZA== Date: Fri, 2 Jun 2023 23:52:54 -0700 From: Jakub Kicinski To: Justin Chen Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, richardcochran@gmail.com, sumit.semwal@linaro.org, christian.koenig@amd.com, simon.horman@corigine.com Subject: Re: [PATCH net-next v6 3/6] net: bcmasp: Add support for ASP2.0 Ethernet controller Message-ID: <20230602235254.61798d80@kernel.org> In-Reply-To: <1685657551-38291-4-git-send-email-justin.chen@broadcom.com> References: <1685657551-38291-1-git-send-email-justin.chen@broadcom.com> <1685657551-38291-4-git-send-email-justin.chen@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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