Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36202
b: refs/heads/master
c: bd8e39f
h: refs/heads/master
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Sep 27, 2006
1 parent 5457f8e commit 0dc93aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a4b9efa1d39d7d31bed08fbe5a9b2a03b2759d4
refs/heads/master: bd8e39f9e4c0960541c8c69e1f7cb321574d7c90
14 changes: 3 additions & 11 deletions trunk/arch/i386/kernel/microcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ static int microcode_sanity_check(void *mc)

total_size = get_totalsize(mc_header);
data_size = get_datasize(mc_header);
if ((data_size + MC_HEADER_SIZE > total_size)
|| (data_size < DEFAULT_UCODE_DATASIZE)) {
if (data_size + MC_HEADER_SIZE > total_size) {
printk(KERN_ERR "microcode: error! "
"Bad data size in microcode data file\n");
return -EINVAL;
Expand Down Expand Up @@ -365,8 +364,7 @@ static long get_next_ucode(void **mc, long offset)
return -EFAULT;
}
total_size = get_totalsize(&mc_header);
if ((offset + total_size > user_buffer_size)
|| (total_size < DEFAULT_UCODE_TOTALSIZE)) {
if (offset + total_size > user_buffer_size) {
printk(KERN_ERR "microcode: error! Bad total size in microcode "
"data file\n");
return -EINVAL;
Expand Down Expand Up @@ -432,11 +430,6 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_
{
ssize_t ret;

if (len < DEFAULT_UCODE_TOTALSIZE) {
printk(KERN_ERR "microcode: not enough data\n");
return -EINVAL;
}

if ((len >> PAGE_SHIFT) > num_physpages) {
printk(KERN_ERR "microcode: too much data (max %ld pages)\n", num_physpages);
return -EINVAL;
Expand Down Expand Up @@ -508,8 +501,7 @@ static long get_next_ucode_from_buffer(void **mc, void *buf,
mc_header = (microcode_header_t *)(buf + offset);
total_size = get_totalsize(mc_header);

if ((offset + total_size > size)
|| (total_size < DEFAULT_UCODE_TOTALSIZE)) {
if (offset + total_size > size) {
printk(KERN_ERR "microcode: error! Bad data in microcode data file\n");
return -EINVAL;
}
Expand Down

0 comments on commit 0dc93aa

Please sign in to comment.