Skip to content

Commit

Permalink
selftests: mptcp: close fd_in before returning in main_loop
Browse files Browse the repository at this point in the history
commit c183165 upstream.

The file descriptor 'fd_in' is opened when cfg_input is configured, but
not closed in main_loop(), this patch fixes it.

Fixes: 05be5e2 ("selftests: mptcp: add disconnect tests")
Cc: stable@vger.kernel.org
Co-developed-by: Cong Liu <liucong2@kylinos.cn>
Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250328-net-mptcp-misc-fixes-6-15-v1-3-34161a482a7f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Geliang Tang authored and Greg Kroah-Hartman committed Apr 25, 2025
1 parent 0d527af commit 970688e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/testing/selftests/net/mptcp/mptcp_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ int main_loop(void)

ret = copyfd_io(fd_in, fd, 1, 0, &winfo);
if (ret)
return ret;
goto out;

if (cfg_truncate > 0) {
shutdown(fd, SHUT_WR);
Expand All @@ -1320,7 +1320,10 @@ int main_loop(void)
close(fd);
}

return 0;
out:
if (cfg_input)
close(fd_in);
return ret;
}

int parse_proto(const char *proto)
Expand Down

0 comments on commit 970688e

Please sign in to comment.