Skip to contentSkip to conversation

proc: put task earlier in /proc/*/fail-nth

PATCH New Alexey Dobriyan 1 participant 1 message Jun 27, 2018 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc: put task earlier in /proc/*/fail-nth

---

 fs/proc/base.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/proc/base.c +1 -3
@@ -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 = {