mirror of https://gitee.com/openkylin/linux.git
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
96310fd873
commit
0f46ab461e
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue