net/mlx5: do not close stdin on error
authorDavid Marchand <david.marchand@redhat.com>
Thu, 14 Oct 2021 11:37:18 +0000 (13:37 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Mon, 1 Nov 2021 07:51:48 +0000 (08:51 +0100)
commit7f49dafe0534b8a8614492c052d7fbe2e87dc6ae
tree53550fb4ff8c7ea41c2802128e4ca7e9ac7964e6
parent160f0d11bbab08468fbddb0e5d3ee5bff63a9225
net/mlx5: do not close stdin on error

If for any reason, a socket could not be opened, mlx5_pmd_socket_init()
could close the 0 fd (which is valid, and has a fair chance to be stdin),
since server_socket == 0 from the variable being in .bss.

Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
drivers/net/mlx5/linux/mlx5_socket.c