aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/base.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 5bc587049b37..837469a96598 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1187,17 +1187,16 @@ static ssize_t proc_fault_inject_write(struct file * file,
1187 count = sizeof(buffer) - 1; 1187 count = sizeof(buffer) - 1;
1188 if (copy_from_user(buffer, buf, count)) 1188 if (copy_from_user(buffer, buf, count))
1189 return -EFAULT; 1189 return -EFAULT;
1190 make_it_fail = simple_strtol(buffer, &end, 0); 1190 make_it_fail = simple_strtol(strstrip(buffer), &end, 0);
1191 if (*end == '\n') 1191 if (*end)
1192 end++; 1192 return -EINVAL;
1193 task = get_proc_task(file->f_dentry->d_inode); 1193 task = get_proc_task(file->f_dentry->d_inode);
1194 if (!task) 1194 if (!task)
1195 return -ESRCH; 1195 return -ESRCH;
1196 task->make_it_fail = make_it_fail; 1196 task->make_it_fail = make_it_fail;
1197 put_task_struct(task); 1197 put_task_struct(task);
1198 if (end - buffer == 0) 1198
1199 return -EIO; 1199 return count;
1200 return end - buffer;
1201} 1200}
1202 1201
1203static const struct file_operations proc_fault_inject_operations = { 1202static const struct file_operations proc_fault_inject_operations = {