From ae40da3a1dccef1f442356efd863f20e639046ef Mon Sep 17 00:00:00 2001 From: Lars Schellhas van Kisfeld Date: Mon, 16 Nov 2026 11:00:38 +0100 Subject: [PATCH] platform/surface: platform_profile: fix uninitialized return in pm_prepare surface_platform_profile_pm_prepare() declares "int status;" without an initializer and only assigns it inside the "if (tpd->has_fan)" block. On devices where the "has_fan" property is not set, such as the Surface Pro 7 and the Surface Book 3, the function returns whatever happens to be on the stack. Any non-zero value makes the PM core abort the transition: surface_platform_profile 01:03:01:00:01: PM: device_prepare(): surface_platform_profile_pm_prepare [surface_platform_profile] returns -1050009088 surface_platform_profile 01:03:01:00:01: PM: not prepared for power transition: code -1050009088 PM: Some devices failed to suspend, or early wake event detected and the machine immediately resumes instead of suspending. Initialize status to 0 so that devices without a fan report success. Fixes: 743c726b18f6 ("platform/surface: platform_profile: add fan power state handling") Signed-off-by: Lars Schellhas van Kisfeld --- drivers/platform/surface/surface_platform_profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c index 203d21aa715ce..38d2c3b23ef24 100644 --- a/drivers/platform/surface/surface_platform_profile.c +++ b/drivers/platform/surface/surface_platform_profile.c @@ -260,7 +260,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev) static int surface_platform_profile_pm_prepare(struct device *dev) { struct ssam_platform_profile_device *tpd; - int status; + int status = 0; tpd = dev_get_drvdata(dev);