Hi!
Icenowy Zheng uwu@icenowy.me thermal/of: support thermal zones w/o trips subnode
This seems to introduce memory leak.
+++ b/drivers/thermal/thermal_of.c @@ -238,18 +238,15 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np , int *n ... trips = of_get_child_by_name(np, "trips"); - if (!trips) { - pr_err("Failed to find 'trips' node\n"); - return ERR_PTR(-EINVAL); - } + if (!trips) + return NULL;
count = of_get_child_count(trips); - if (!count) { - pr_err("No trip point defined\n"); - ret = -EINVAL; - goto out_of_node_put; - } + if (!count) + return NULL;
In the !count case, we still need to do the of_node_put, AFAICT.
Best regards, Pavel