Skip to content

Commit 0f46ab4

Browse files
andy-shevmchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 96310fd commit 0f46ab4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,10 @@ static int gmin_get_config_dsm_var(struct device *dev,
11341134
return -EINVAL;
11351135
}
11361136

1137+
/* Return on unexpected object type */
1138+
if (obj->type != ACPI_TYPE_PACKAGE)
1139+
return -EINVAL;
1140+
11371141
#if 0 /* Just for debugging purposes */
11381142
for (i = 0; i < obj->package.count; i++) {
11391143
union acpi_object *cur = &obj->package.elements[i];

0 commit comments

Comments
 (0)