提交 0f46ab46 编写于 作者: A Andy Shevchenko 提交者: 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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册