projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebe119c
)
x86, mce: Fix set_trigger() accessor
author
Jan Beulich
<
[email protected]
>
Thu, 16 Jul 2009 08:45:11 +0000
(09:45 +0100)
committer
H. Peter Anvin
<
[email protected]
>
Tue, 21 Jul 2009 17:49:18 +0000
(10:49 -0700)
Fix the condition checking the result of strchr() (which previously
could result in an oops), and make the function return the number of
bytes actively used.
[ Impact: fix oops ]
Signed-off-by: Jan Beulich <
[email protected]
>
Cc: Andi Kleen <
[email protected]
>
LKML-Reference: <
4A5F04B7020000780000AB59
@vpn.id2.novell.com>
Signed-off-by: H. Peter Anvin <
[email protected]
>
arch/x86/kernel/cpu/mcheck/mce.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/cpu/mcheck/mce.c
b/arch/x86/kernel/cpu/mcheck/mce.c
index 484c1e5f658e6b5d932566cd41f7813c44d00b71..1cfb623ce11c9aa7217ea5d1f794029c10ec3607 100644
(file)
--- a/
arch/x86/kernel/cpu/mcheck/mce.c
+++ b/
arch/x86/kernel/cpu/mcheck/mce.c
@@
-1692,17
+1692,15
@@
static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
const char *buf, size_t siz)
{
char *p;
- int len;
strncpy(mce_helper, buf, sizeof(mce_helper));
mce_helper[sizeof(mce_helper)-1] = 0;
- len = strlen(mce_helper);
p = strchr(mce_helper, '\n');
- if (
*
p)
+ if (p)
*p = 0;
- return
len
;
+ return
strlen(mce_helper) + !!p
;
}
static ssize_t set_ignore_ce(struct sys_device *s,