[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200616153113.952867377@linuxfoundation.org>
Date: Tue, 16 Jun 2020 17:35:49 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Dominik Mierzejewski <dominik@...ysector.net>,
Mattia Dongili <malattia@...ux.it>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH 5.6 159/161] platform/x86: sony-laptop: Make resuming thermal profile safer
From: Mattia Dongili <malattia@...ux.it>
commit 476d60b1b4c8a2b14a53ef9b772058f35e604661 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: 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer objects for ASL create_field() operator")
Reported-by: Dominik Mierzejewski <dominik@...ysector.net>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207491
Signed-off-by: Mattia Dongili <malattia@...ux.it>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/platform/x86/sony-laptop.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2288,7 +2288,12 @@ static void sony_nc_thermal_cleanup(stru
#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);
Powered by blists - more mailing lists