kernel: Avoid double lock in wait_for_child with child == team.

When wait_for_child was called with a child argument equal to the
current team, the team was locked again to check if it was a child of
itself.

This is now handled the same way as on other systems, where this case
results in ECHILD (and not EINVAL).
This commit is contained in:
Michael Lotz
2018-01-03 01:10:29 +01:00
parent b1ab02c434
commit afe8d6621d
+1 -1
View File
@@ -2459,7 +2459,7 @@ wait_for_child(pid_t child, uint32 flags, siginfo_t& _info,
childrenExist = team->children != NULL;
} else if (child < -1) {
childrenExist = has_children_in_group(team, -child);
} else {
} else if (child != team->id) {
if (Team* childTeam = Team::Get(child)) {
BReference<Team> childTeamReference(childTeam, true);
TeamLocker childTeamLocker(childTeam);