net/virtio-user: check file descriptor before closing
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 6 Jan 2020 19:18:37 +0000 (11:18 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:02 +0000 (19:46 +0100)
commitb56c12acf20585ad46faf9455b4b9aeb30450ef0
tree7f845a70f3a16cd2e2154e4b2a45819300ffc91d
parentf04513bc89d90c2ad425f1be1e4716bb3c790fb2
net/virtio-user: check file descriptor before closing

Valgrind complains that virtio_user is calling close(-1).
Fix this by adding check in virtio that is similar to existing code.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c