net/virtio-user: fix run closing stdin and close callfd
authorJiawei Zhu <zhujiawei12@huawei.com>
Fri, 11 Dec 2020 16:53:18 +0000 (00:53 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 17:07:55 +0000 (18:07 +0100)
commit97ed740c3498afab4162cb85492cd3109e21c604
tree1c12dc27682bf086e6c0c564054c193c4fb95d20
parent05421ec938eafc4fb5a7eda48a31a2b0d4174f8b
net/virtio-user: fix run closing stdin and close callfd

When i < VIRTIO_MAX_VIRTQUEUES and j == i,
dev->callfds[i] and dev->kickfds[i] are default 0.
So it will close(0), close the standard input (stdin).

And when the code fails in kickfd creation,
it will leaves one callfd not closed.

Fixes: e6e7ad8b3024 ("net/virtio-user: move eventfd open/close into init/uninit")
Cc: stable@dpdk.org:
Signed-off-by: Jiawei Zhu <zhujiawei12@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c