summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorLawrence Yiu <lawyiu.dev@gmail.com>2016-03-21 11:44:22 +0300
committerDarren Hart <dvhart@linux.intel.com>2016-05-06 02:32:32 +0300
commitddd9357f6017a8c61a20685feab5ce9eee635f6c (patch)
treeb98c4344cf99bc598e33f218f6f066a417507a34 /drivers/platform/x86
parent775d054aba90a2c787d4c081d6369f1fddaae0f4 (diff)
downloadlinux-ddd9357f6017a8c61a20685feab5ce9eee635f6c.tar.xz
sony-laptop: Avoid oops on module unload for older laptops
Older VAIO laptops without the SN00 ACPI method will have the "handles" variable unset. Return early from sony_nc_function_cleanup when "handles" is null. Signed-off-by: Lawrence Yiu <lawyiu.dev@gmail.com> Acked-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/sony-laptop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index e9caa347a9bf..1dba3598cfcb 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1446,6 +1446,9 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
{
unsigned int i, result, bitmask, handle;
+ if (!handles)
+ return;
+
/* get enabled events and disable them */
sony_nc_int_call(sony_nc_acpi_handle, "SN01", NULL, &bitmask);
sony_nc_int_call(sony_nc_acpi_handle, "SN03", &bitmask, &result);