Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddd9357f authored by Lawrence Yiu's avatar Lawrence Yiu Committed by Darren Hart
Browse files

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: default avatarLawrence Yiu <lawyiu.dev@gmail.com>
Acked-by: default avatarMattia Dongili <malattia@linux.it>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 775d054a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);