net/virtio: fix listen file initialization
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Mon, 1 Feb 2021 09:33:17 +0000 (10:33 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 2 Feb 2021 23:48:11 +0000 (00:48 +0100)
commit0ea5be8d250408b0b6c6ae2105aabc5b73978f3e
treea201a3dda8f108345cd8878740dfd8e85b45c1c2
parentd700f0d0d7074c76a94c0278315acb86f9ea30ba
net/virtio: fix listen file initialization

When running in client mode, the listen file descriptor
is not initialized, and so has value 0. At destroy time,
the listen FD is closed if its value is greater than or
equal to zero, which causes STDIN to be closed.

Bugzilla ID: 630
Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend")

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
drivers/net/virtio/virtio_user/vhost_user.c