All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sony-laptop: Avoid oops on module unload for older laptops
@ 2016-03-21  8:44 Lawrence Yiu
  2016-03-22 13:51 ` Mattia Dongili
  2016-05-05 23:22 ` Darren Hart
  0 siblings, 2 replies; 3+ messages in thread
From: Lawrence Yiu @ 2016-03-21  8:44 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: malattia

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>
---
 drivers/platform/x86/sony-laptop.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index e9caa34..1dba359 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);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-05 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-21  8:44 [PATCH] sony-laptop: Avoid oops on module unload for older laptops Lawrence Yiu
2016-03-22 13:51 ` Mattia Dongili
2016-05-05 23:22 ` Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.