vhost-user-gpu: do not send scanout update if no GPU socket
Should fix coverity CID 1401760.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190605145829.7674-2-marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
diff --git a/contrib/vhost-user-gpu/main.c b/contrib/vhost-user-gpu/main.c
index f9e2146..9614c94 100644
--- a/contrib/vhost-user-gpu/main.c
+++ b/contrib/vhost-user-gpu/main.c
@@ -354,7 +354,7 @@
scanout->width = 0;
scanout->height = 0;
- {
+ if (g->sock_fd >= 0) {
VhostUserGpuMsg msg = {
.request = VHOST_USER_GPU_SCANOUT,
.size = sizeof(VhostUserGpuScanout),