ASoC: SOF: Intel: Initialize hdaudio bus properly
[linux-2.6-microblaze.git] / drivers / remoteproc / remoteproc_elf_loader.c
index 215a440..606aae1 100644 (file)
@@ -247,8 +247,7 @@ find_table(struct device *dev, struct elf32_hdr *ehdr, size_t fw_size)
                }
 
                /* make sure the offsets array isn't truncated */
-               if (table->num * sizeof(table->offset[0]) +
-                               sizeof(struct resource_table) > size) {
+               if (struct_size(table, offset, table->num) > size) {
                        dev_err(dev, "resource table incomplete\n");
                        return NULL;
                }