Skip to content

Commit 476d60b

Browse files
malattiaandy-shev
authored andcommitted
platform/x86: sony-laptop: Make resuming thermal profile safer
The thermal handle object may fail initialization when the module is loaded in the first place. Avoid attempting to use it on resume then. Fixes: 6d232b2 ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator") Reported-by: Dominik Mierzejewski <[email protected]> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491 Signed-off-by: Mattia Dongili <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 47828d2 commit 476d60b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/platform/x86/sony-laptop.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,12 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
22882288
#ifdef CONFIG_PM_SLEEP
22892289
static void sony_nc_thermal_resume(void)
22902290
{
2291-
unsigned int status = sony_nc_thermal_mode_get();
2291+
int status;
2292+
2293+
if (!th_handle)
2294+
return;
2295+
2296+
status = sony_nc_thermal_mode_get();
22922297

22932298
if (status != th_handle->mode)
22942299
sony_nc_thermal_mode_set(th_handle->mode);

0 commit comments

Comments
 (0)