提交 ddd9357f 编写于 作者: L Lawrence Yiu 提交者: Darren Hart

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: NLawrence Yiu <lawyiu.dev@gmail.com>
Acked-by: NMattia Dongili <malattia@linux.it>
Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
上级 775d054a
...@@ -1446,6 +1446,9 @@ static void sony_nc_function_cleanup(struct platform_device *pd) ...@@ -1446,6 +1446,9 @@ static void sony_nc_function_cleanup(struct platform_device *pd)
{ {
unsigned int i, result, bitmask, handle; unsigned int i, result, bitmask, handle;
if (!handles)
return;
/* get enabled events and disable them */ /* 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, "SN01", NULL, &bitmask);
sony_nc_int_call(sony_nc_acpi_handle, "SN03", &bitmask, &result); sony_nc_int_call(sony_nc_acpi_handle, "SN03", &bitmask, &result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册