From patchwork Fri Feb 7 01:31:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Zekun X-Patchwork-Id: 863172 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 A6B0014F9FF; Fri, 7 Feb 2025 01:39:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892391; cv=none; b=DAHbBAVbBw9zUhxhi56pVpLCjDwmrnUKOa6xt5fCR4CnK0lRZuD+gzFhBJYigjmUPa76j7UUhsBaij9PusbPGtlOTxWaY+KOpP7zwy0bPoooRGZveeQRskhEvUfwc7pWwZtV/tSHoWaLDbMFi8PCE0CoG4WfjGDJirxZ8xYBg2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738892391; c=relaxed/simple; bh=1hQa0rb30YjPWJmEFp08HbH73q83lHNBrJsFri4y1Pg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VOtdtNT3+hnqK1eEq7qJcnOwgtFowh2O9LArcwTNX8x6r57e48baML616u5abG5OVRZT/xIinwaEfQQjFmUulwkCFShU2+VN4jMEUpuZigbcovcxJfFeHn9FG2Pv4K73dY8fz3eSGFxAv7OdeCMVpir4ZRFbRDLwK5HHuS6o3R0= 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.189 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.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4YpxQy6DbnzmZC4; Fri, 7 Feb 2025 09:36:58 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 21BB41400DD; Fri, 7 Feb 2025 09:39:46 +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:44 +0800 From: Zhang Zekun To: , , , , , , , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH 3/9] net: pse-pd: Add missing of_node_get() before of_find_node_by_name() Date: Fri, 7 Feb 2025 09:31:11 +0800 Message-ID: <20250207013117.104205-4-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 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 --- drivers/net/pse-pd/tps23881.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 5e9dda2c0eac..a595358ac60b 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -502,7 +502,7 @@ tps23881_get_of_channels(struct tps23881_priv *priv, if (!priv->np) return -EINVAL; - channels_node = of_find_node_by_name(priv->np, "channels"); + channels_node = of_find_node_by_name_balanced(priv->np, "channels"); if (!channels_node) return -EINVAL;