From patchwork Thu Oct 24 01:59:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Zekun X-Patchwork-Id: 13848180 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 A871A2AF09 for ; Thu, 24 Oct 2024 02:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729735442; cv=none; b=oxjFt/+4uyWSyAdXW2YxBa6b4j2AU6uO9GZhyyO8L/+hrm26CzPuQ2wFT1N/Usj4n8tdvHRme3YKmjD7ZgSlacicKcCPdSEQJYebS98B5FA3Qa2/ZBgqL7MYBxyTPwHt4LO0FjoD2FHY3R6cU7C0yC1AmVkYnI0hFqTJtyZc/4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729735442; c=relaxed/simple; bh=hA2ckDoFx4DgvYUJrbDpXVTEJVcI8+i1/52TH1ZQ1m4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MZk6FFU8q7O1v965tZWEHFounemOtaUSf0AI5k2Joa5TUAlrznaQ0L+C9ZYAsjVephJfB4mQDCeTihqE3jgqjr/lLEi+4TPckcrmLLfeTedUsj/SWyRTYbDYYzvRFyzW15fsoO0gWgeAUhHNyxCnWYPLq1YeVNUjacf300GW0Ko= 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.191 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 szxga05-in.huawei.com (SkyGuard) with ESMTP id 4XYq1Q27MHz1jvqb; Thu, 24 Oct 2024 10:02:34 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 198C1180044; Thu, 24 Oct 2024 10:03:58 +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; Thu, 24 Oct 2024 10:03:57 +0800 From: Zhang Zekun To: , , , , , , , , , , CC: , Subject: [PATCH net 1/2] net: bcmasp: Add missing of_node_get() before of_find_node_by_name() Date: Thu, 24 Oct 2024 09:59:08 +0800 Message-ID: <20241024015909.58654-2-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241024015909.58654-1-zhangzekun11@huawei.com> References: <20241024015909.58654-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemf500003.china.huawei.com (7.202.181.241) X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Justin Chen --- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index 297c2682a9cf..517593c58945 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -1367,6 +1367,7 @@ static int bcmasp_probe(struct platform_device *pdev) bcmasp_core_init(priv); bcmasp_core_init_filters(priv); + of_node_get(dev->of_node); ports_node = of_find_node_by_name(dev->of_node, "ethernet-ports"); if (!ports_node) { dev_warn(dev, "No ports found\n"); From patchwork Thu Oct 24 01:59:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Zekun X-Patchwork-Id: 13848181 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 3B04F1CAAC for ; Thu, 24 Oct 2024 02:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729735443; cv=none; b=iDrqxoAQaAwi3hbHsSLakZZztX2m4p7DrtihUZEb7vn7eGBFoOV2GINvFao0iCrbOc1ywaBX/BV4Lww7VJqjQEqkntxFMcmcBcG7r0mD1+si7DhIGaannJEwjPgteQj69MXmMDrHsH7J3/2ujM6GSbYc9g2HaASrZwS9bPhG/k8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729735443; c=relaxed/simple; bh=sCx5v/g5c/vl881k3lHZ6MEwPkK5N8967V0HHcGOIrI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jUgJIvQD0hMYz+lwBA/yN12E0EIlFO1BKI+jPVd9yEzmu5hbpQCKNLznP4saf4+IyefuzlXJFp02xdz3QtVnmG672Xwbi7ubTxhb2KbznXSLGEdtz4nzrEUHttjQwPw3i2QubiOgtxprvqKALKh5T0UkIU+/B3R9FINtdKprXyI= 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.255 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.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XYq0h4CRHz1T98x; Thu, 24 Oct 2024 10:01:56 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 174541402E1; Thu, 24 Oct 2024 10:03:59 +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; Thu, 24 Oct 2024 10:03:57 +0800 From: Zhang Zekun To: , , , , , , , , , , CC: , Subject: [PATCH net 2/2] net: pse-pd: Add missing of_node_get() before of_find_node_by_name() Date: Thu, 24 Oct 2024 09:59:09 +0800 Message-ID: <20241024015909.58654-3-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20241024015909.58654-1-zhangzekun11@huawei.com> References: <20241024015909.58654-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemf500003.china.huawei.com (7.202.181.241) X-Patchwork-Delegate: kuba@kernel.org of_find_node_by_name() will decrease the refount of the device_node. So, get the device_node before passing to it. Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver") Signed-off-by: Zhang Zekun Acked-by: Oleksij Rempel Acked-by: Kory Maincent --- drivers/net/pse-pd/tps23881.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 5c4e88be46ee..f5c04dd5be37 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -216,6 +216,7 @@ tps23881_get_of_channels(struct tps23881_priv *priv, if (!priv->np) return -EINVAL; + of_node_get(priv->np); channels_node = of_find_node_by_name(priv->np, "channels"); if (!channels_node) return -EINVAL;