From: Greg Kroah-Hartman Date: Thu, 6 Mar 2025 09:17:29 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v6.6.81~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ae8bd835de88a2f8b0eae86c93dbcdcfc09e552;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: thermal-gov_power_allocator-add-missing-null-pointer-check.patch --- diff --git a/queue-6.12/series b/queue-6.12/series index 77bb5a8102..85aeb765f0 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -148,3 +148,4 @@ x86-microcode-amd-merge-early_apply_microcode-into-its-single-callsite.patch x86-microcode-amd-get-rid-of-the-_load_microcode_amd-forward-declaration.patch x86-microcode-amd-add-get_patch_level.patch x86-microcode-amd-load-only-sha256-checksummed-patches.patch +thermal-gov_power_allocator-add-missing-null-pointer-check.patch diff --git a/queue-6.12/thermal-gov_power_allocator-add-missing-null-pointer-check.patch b/queue-6.12/thermal-gov_power_allocator-add-missing-null-pointer-check.patch new file mode 100644 index 0000000000..3f94d94e0c --- /dev/null +++ b/queue-6.12/thermal-gov_power_allocator-add-missing-null-pointer-check.patch @@ -0,0 +1,47 @@ +From ac1f43c03fc91eee53cc95683245350d4d87781e Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Mon, 25 Nov 2024 12:24:46 +0100 +Subject: thermal: gov_power_allocator: Add missing NULL pointer check + +From: Rafael J. Wysocki + +commit ac1f43c03fc91eee53cc95683245350d4d87781e upstream. + +Commit 0dc23567c206 ("thermal: core: Move lists of thermal instances +to trip descriptors") overlooked the case in which the Power Allocator +governor attempts to bind to a tripless thermal zone and params->trip_max +is NULL in check_power_actors(). + +No power actors can be found in that case, so check_power_actors() needs +to be made return 0 then to restore its previous behavior. + +Fixes: 0dc23567c206 ("thermal: core: Move lists of thermal instances to trip descriptors") +Closes: https://lore.kernel.org/linux-pm/Z0NeGF4ryCe_b5rr@sashalap/ +Reported-by: Sasha Levin +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Lukasz Luba +Link: https://patch.msgid.link/2761105.mvXUDI8C0e@rjwysocki.net +Signed-off-by: Greg Kroah-Hartman +--- + drivers/thermal/gov_power_allocator.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/thermal/gov_power_allocator.c ++++ b/drivers/thermal/gov_power_allocator.c +@@ -582,10 +582,15 @@ static void allow_maximum_power(struct t + static int check_power_actors(struct thermal_zone_device *tz, + struct power_allocator_params *params) + { +- const struct thermal_trip_desc *td = trip_to_trip_desc(params->trip_max); ++ const struct thermal_trip_desc *td; + 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",