proc: put task earlier in /proc/*/fail-nth
diff mbox series

Message ID 20180627195427.GE18113@avx2
State New, archived
Headers show
Series
  • proc: put task earlier in /proc/*/fail-nth
Related show

Commit Message

Alexey Dobriyan June 27, 2018, 7:54 p.m. UTC
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/proc/base.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch
diff mbox series

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1366,10 +1366,8 @@  static ssize_t proc_fail_nth_read(struct file *file, char __user *buf,
 	if (!task)
 		return -ESRCH;
 	len = snprintf(numbuf, sizeof(numbuf), "%u\n", task->fail_nth);
-	len = simple_read_from_buffer(buf, count, ppos, numbuf, len);
 	put_task_struct(task);
-
-	return len;
+	return simple_read_from_buffer(buf, count, ppos, numbuf, len);
 }
 
 static const struct file_operations proc_fail_nth_operations = {