Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79992
b: refs/heads/master
c: 8c8b885
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Walker authored and Ingo Molnar committed Jan 30, 2008
1 parent 5c66e82 commit 7409771
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: fa20efd2fcd9349770113c6f72fc76ce437b62f5
refs/heads/master: 8c8b8859b64baf6d7c33900e8720c7bafe775b2c
8 changes: 4 additions & 4 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
loff_t *off)
{
unsigned long *cpu_tsc;
static DECLARE_MUTEX(mce_read_sem);
static DEFINE_MUTEX(mce_read_mutex);
unsigned next;
char __user *buf = ubuf;
int i, err;
Expand All @@ -573,12 +573,12 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
if (!cpu_tsc)
return -ENOMEM;

down(&mce_read_sem);
mutex_lock(&mce_read_mutex);
next = rcu_dereference(mcelog.next);

/* Only supports full reads right now */
if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
up(&mce_read_sem);
mutex_unlock(&mce_read_mutex);
kfree(cpu_tsc);
return -EINVAL;
}
Expand Down Expand Up @@ -621,7 +621,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
memset(&mcelog.entry[i], 0, sizeof(struct mce));
}
}
up(&mce_read_sem);
mutex_unlock(&mce_read_mutex);
kfree(cpu_tsc);
return err ? -EFAULT : buf - ubuf;
}
Expand Down

0 comments on commit 7409771

Please sign in to comment.