Merge branches 'devel-stable' and 'misc' into for-linus
[linux-2.6-microblaze.git] / sound / hda / intel-nhlt.c
index d053bec..e223723 100644 (file)
@@ -39,6 +39,11 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
        if (!nhlt)
                return 0;
 
+       if (nhlt->header.length <= sizeof(struct acpi_table_header)) {
+               dev_warn(dev, "Invalid DMIC description table\n");
+               return 0;
+       }
+
        for (j = 0, epnt = nhlt->desc; j < nhlt->endpoint_count; j++,
             epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length)) {