summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2020-05-08 09:14:05 +0900
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-05-12 17:27:11 +0300
commit476d60b1b4c8a2b14a53ef9b772058f35e604661 (patch)
tree7ec325fbcec0fe90bdc061f5ae7e027f1fc61675 /drivers/platform
parent47828d22539f76c8c9dcf2a55f18ea3a8039d8ef (diff)
downloadlinux-476d60b1b4c8a2b14a53ef9b772058f35e604661.tar.bz2
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: 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator") Reported-by: Dominik Mierzejewski <dominik@greysector.net> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491 Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/sony-laptop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 6932cd11e660..e5a1b5533408 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2288,7 +2288,12 @@ static void sony_nc_thermal_cleanup(struct platform_device *pd)
#ifdef CONFIG_PM_SLEEP
static void sony_nc_thermal_resume(void)
{
- unsigned int status = sony_nc_thermal_mode_get();
+ int status;
+
+ if (!th_handle)
+ return;
+
+ status = sony_nc_thermal_mode_get();
if (status != th_handle->mode)
sony_nc_thermal_mode_set(th_handle->mode);