summaryrefslogtreecommitdiff
path: root/usr/src/common/ucode/ucode_utils.c
diff options
context:
space:
mode:
authorJohn Sonnenschein <johns@joyent.com>2012-05-17 18:26:57 +0000
committerJohn Sonnenschein <johns@joyent.com>2012-05-17 18:26:57 +0000
commit04b244dd661c24b510ac22936decfc0972d202d3 (patch)
tree3ebfef98afc303fddf3415d6fba64e8682f495e8 /usr/src/common/ucode/ucode_utils.c
parenteac250589e41f1b705e1b7427b02b3379aac9f9e (diff)
parenta69187741b83640a90dd8586195456dd50c016a8 (diff)
downloadillumos-joyent-20120517.tar.gz
Merge git.joyent.com:illumos-joyent20120517
Diffstat (limited to 'usr/src/common/ucode/ucode_utils.c')
-rw-r--r--usr/src/common/ucode/ucode_utils.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/usr/src/common/ucode/ucode_utils.c b/usr/src/common/ucode/ucode_utils.c
index 5878f4a4af..7721c5c310 100644
--- a/usr/src/common/ucode/ucode_utils.c
+++ b/usr/src/common/ucode/ucode_utils.c
@@ -142,21 +142,14 @@ ucode_validate_amd(uint8_t *ucodep, int size)
ptr = (uint32_t *)(((uint8_t *)ptr) + count);
size -= count;
- /*
- * minimum valid size:
- * - type and size fields (8 bytes)
- * - patch header (64 bytes)
- * - one patch triad (28 bytes)
- */
- while (size >= 100) {
+ while (size > 8) {
/* microcode patch */
size -= 4;
if (*ptr++ != 1)
return (EM_FILEFORMAT);
size -= 4;
- if (((count = *ptr++) > size) ||
- ((count - sizeof (ucode_header_amd_t)) % 28))
+ if (((count = *ptr++) > size))
return (EM_FILEFORMAT);
/* LINTED: pointer alignment */