mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
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>
This commit is contained in:
parent
775d054aba
commit
ddd9357f60
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user