diff options
Diffstat (limited to 'arch/x86/kernel/msr.c')
-rw-r--r-- | arch/x86/kernel/msr.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index 98fd6cd4e3a4..2cfbb4b2c422 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
@@ -80,11 +80,8 @@ static ssize_t msr_read(struct file *file, char __user *buf, | |||
80 | 80 | ||
81 | for (; count; count -= 8) { | 81 | for (; count; count -= 8) { |
82 | err = rdmsr_safe_on_cpu(cpu, reg, &data[0], &data[1]); | 82 | err = rdmsr_safe_on_cpu(cpu, reg, &data[0], &data[1]); |
83 | if (err) { | 83 | if (err) |
84 | if (err == -EFAULT) /* Fix idiotic error code */ | ||
85 | err = -EIO; | ||
86 | break; | 84 | break; |
87 | } | ||
88 | if (copy_to_user(tmp, &data, 8)) { | 85 | if (copy_to_user(tmp, &data, 8)) { |
89 | err = -EFAULT; | 86 | err = -EFAULT; |
90 | break; | 87 | break; |
@@ -115,11 +112,8 @@ static ssize_t msr_write(struct file *file, const char __user *buf, | |||
115 | break; | 112 | break; |
116 | } | 113 | } |
117 | err = wrmsr_safe_on_cpu(cpu, reg, data[0], data[1]); | 114 | err = wrmsr_safe_on_cpu(cpu, reg, data[0], data[1]); |
118 | if (err) { | 115 | if (err) |
119 | if (err == -EFAULT) /* Fix idiotic error code */ | ||
120 | err = -EIO; | ||
121 | break; | 116 | break; |
122 | } | ||
123 | tmp += 2; | 117 | tmp += 2; |
124 | bytes += 8; | 118 | bytes += 8; |
125 | } | 119 | } |