diff options
Diffstat (limited to 'arch/x86/kernel/cpu/mcheck/mce.c')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 484c1e5f658e..1cfb623ce11c 100644 --- 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, | |||
1692 | const char *buf, size_t siz) | 1692 | const char *buf, size_t siz) |
1693 | { | 1693 | { |
1694 | char *p; | 1694 | char *p; |
1695 | int len; | ||
1696 | 1695 | ||
1697 | strncpy(mce_helper, buf, sizeof(mce_helper)); | 1696 | strncpy(mce_helper, buf, sizeof(mce_helper)); |
1698 | mce_helper[sizeof(mce_helper)-1] = 0; | 1697 | mce_helper[sizeof(mce_helper)-1] = 0; |
1699 | len = strlen(mce_helper); | ||
1700 | p = strchr(mce_helper, '\n'); | 1698 | p = strchr(mce_helper, '\n'); |
1701 | 1699 | ||
1702 | if (*p) | 1700 | if (p) |
1703 | *p = 0; | 1701 | *p = 0; |
1704 | 1702 | ||
1705 | return len; | 1703 | return strlen(mce_helper) + !!p; |
1706 | } | 1704 | } |
1707 | 1705 | ||
1708 | static ssize_t set_ignore_ce(struct sys_device *s, | 1706 | static ssize_t set_ignore_ce(struct sys_device *s, |