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

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
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment