[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240823071555.3331632-1-ruanjinjie@huawei.com>
Date: Fri, 23 Aug 2024 15:15:55 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <rafael@...nel.org>, <daniel.lezcano@...aro.org>, <rui.zhang@...el.com>,
<lukasz.luba@....com>, <linux-pm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next] thermal/of: Fix duplicate of_node_put()
In for_each_child_of_node(), if continue, of_node_put(prev) will be
called by __of_get_next_child(), so remove the duplicate
of_node_put(child).
Fixes: 0f0a1b4ba3e4 ("thermal/of: Use the .should_bind() thermal zone callback")
Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
drivers/thermal/thermal_of.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index dc43f50db890..85e7e3c43c7e 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -319,10 +319,8 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
int count, i;
tr_np = of_parse_phandle(child, "trip", 0);
- if (tr_np != trip->priv) {
- of_node_put(child);
+ if (tr_np != trip->priv)
continue;
- }
/* The trip has been found, look up the cdev. */
count = of_count_phandle_with_args(child, "cooling-device", "#cooling-cells");
--
2.34.1
Powered by blists - more mailing lists