Commit 0f46ab46 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: Don't try to parse unexpected ACPI object type



There are devices with completely different _DSM() format,
and accessing object as a package leads to crashes.

Bail out in the case of unexpected object type.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 96310fd8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1134,6 +1134,10 @@ static int gmin_get_config_dsm_var(struct device *dev,
		return -EINVAL;
	}

	/* Return on unexpected object type */
	if (obj->type != ACPI_TYPE_PACKAGE)
		return -EINVAL;

#if 0 /* Just for debugging purposes */
	for (i = 0; i < obj->package.count; i++) {
		union acpi_object *cur = &obj->package.elements[i];