mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
selftests: mptcp: always close input's FD if opened
In main_loop_s function, when the open(cfg_input, O_RDONLY) function is
run, the last fd is not closed if the "--cfg_repeat > 0" branch is not
taken.
Fixes: 05be5e273c ("selftests: mptcp: add disconnect tests")
Cc: stable@vger.kernel.org
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4a2f48992d
commit
7c70bcc2a8
|
|
@ -1115,11 +1115,11 @@ int main_loop_s(int listensock)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (--cfg_repeat > 0) {
|
||||
if (cfg_input)
|
||||
close(fd);
|
||||
if (cfg_input)
|
||||
close(fd);
|
||||
|
||||
if (--cfg_repeat > 0)
|
||||
goto again;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user