Skip to content

Commit

Permalink
platform/x86: sony-laptop: Make resuming thermal profile safer
Browse files Browse the repository at this point in the history
commit 476d60b upstream.

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 <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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mattia Dongili authored and Greg Kroah-Hartman committed Jun 17, 2020
1 parent 4417492 commit a688d4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a688d4d

Please sign in to comment.