Index: sys/dev/pci/if_iwi.c *************** *** 2215,2221 **** hdr = (const struct iwi_firmware_hdr *)sc->sc_blob; ! if (size < sizeof(struct iwi_firmware_hdr) + hdr->bsize + hdr->usize + hdr->fsize) { aprint_error_dev(sc->sc_dev, "image '%s' too small\n", sc->sc_fwname); error = EIO; --- 2215,2221 ---- hdr = (const struct iwi_firmware_hdr *)sc->sc_blob; ! if (size < sizeof(struct iwi_firmware_hdr) + le32toh(hdr->bsize) + le32toh(hdr->usize) + le32toh(hdr->fsize)) { aprint_error_dev(sc->sc_dev, "image '%s' too small\n", sc->sc_fwname); error = EIO; *************** *** 2235,2243 **** goto fail2; } ! kfw->boot_size = hdr->bsize; ! kfw->ucode_size = hdr->usize; ! kfw->main_size = hdr->fsize; fw = sc->sc_blob + sizeof(struct iwi_firmware_hdr); kfw->boot = fw; --- 2235,2243 ---- goto fail2; } ! kfw->boot_size = le32toh(hdr->bsize); ! kfw->ucode_size = le32toh(hdr->usize); ! kfw->main_size = le32toh(hdr->fsize); fw = sc->sc_blob + sizeof(struct iwi_firmware_hdr); kfw->boot = fw;