From patchwork Fri Feb 7 01:31:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13964197 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21E101632F3; Fri, 7 Feb 2025 01:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892390; cv=none; b=V5aiWpqZTf34JflZPfINgBczuJBtomXMy6iltSmyxOW6K9yc38ie6A+qfc5stP4+Trj7aAbO+iEqc54MYSaycV+BfsFHYUn03nvegI5bwz4eUFoK6u4+0QNSESE1635kTbjC8vIfjdbCBe+BmuQplV4jzcbJgZU6GLa2VbVl8yQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892390; c=relaxed/simple; bh=DGDeZI5Y519XLRmyvGBhMCPLk42GyCZ5Apcu0CIUCNY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bC++Mcffn/h7M6PCtK0KuiMtv1FVBdQMBC1DhrVb/D+/C2HLODKGZcI30v0mSBW7ah1slAWlN9Rv1fmRZYcjhfEFFoxUwZNnxG6A6u6AiuDabKsg8F5PkVhhq5FfqbJ7xmo0xeyjRgkEH3ZWVk0jwqx+QDvqeKHgS+A268p0/Yk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4YpxPx2CKLz2Fd0Z; Fri, 7 Feb 2025 09:36:05 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 579D2180216; Fri, 7 Feb 2025 09:39:44 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 7 Feb 2025 09:39:42 +0800 From: Zhang Zekun To: , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH 2/9] net: bcmasp: Add missing of_node_get() before of_find_node_by_name() Date: Fri, 7 Feb 2025 09:31:10 +0800 Message-ID: <20250207013117.104205-3-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250207013117.104205-1-zhangzekun11@huawei.com> References: <20250207013117.104205-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) of_find_node_by_name() will decrease the refcount of the device_node. So, get the device_node before passing to it. Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller") Signed-off-by: Zhang Zekun --- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index a68fab1b05f0..093c8ea72af9 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -1367,7 +1367,7 @@ static int bcmasp_probe(struct platform_device *pdev) bcmasp_core_init(priv); bcmasp_core_init_filters(priv); - ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports"); + ports_node = of_find_node_by_name_balanced(dev->of_node, "ethernet-ports"); if (!ports_node) { dev_warn(dev, "No ports found\n"); return -EINVAL;