From 9b718b1203fcb51f6398e13a72ef51fd56d3011d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 10 Mar 2025 15:16:07 +0000 Subject: [PATCH] Revert "thermal: gov_power_allocator: Add missing NULL pointer check" This reverts commit 72cbaf8b41f00edc2482372da3770d2d7b5d3d1e which is commit ac1f43c03fc91eee53cc95683245350d4d87781e upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I6b8bcae70e9c70a95407d88a30ba693648614c76 Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/gov_power_allocator.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 8a9420527db7..b00da17c66a9 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -582,15 +582,10 @@ static void allow_maximum_power(struct thermal_zone_device *tz) static int check_power_actors(struct thermal_zone_device *tz, struct power_allocator_params *params) { - const struct thermal_trip_desc *td; + const struct thermal_trip_desc *td = trip_to_trip_desc(params->trip_max); struct thermal_instance *instance; int ret = 0; - if (!params->trip_max) - return 0; - - td = trip_to_trip_desc(params->trip_max); - list_for_each_entry(instance, &td->thermal_instances, trip_node) { if (!cdev_is_power_actor(instance->cdev)) { dev_warn(&tz->device, "power_allocator: %s is not a power actor\n",