net/ice/base: fix uninitialized stack variables
[dpdk.git] / lib / librte_vhost / socket.c
index 9740fb3..7c80121 100644 (file)
@@ -127,7 +127,8 @@ read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds,
 
        ret = recvmsg(sockfd, &msgh, 0);
        if (ret <= 0) {
-               VHOST_LOG_CONFIG(ERR, "recvmsg failed\n");
+               if (ret)
+                       VHOST_LOG_CONFIG(ERR, "recvmsg failed\n");
                return ret;
        }
 
@@ -318,16 +319,16 @@ vhost_user_read_cb(int connfd, void *dat, int *remove)
 
                vhost_destroy_device(conn->vid);
 
+               if (vsocket->reconnect) {
+                       create_unix_socket(vsocket);
+                       vhost_user_start_client(vsocket);
+               }
+
                pthread_mutex_lock(&vsocket->conn_mutex);
                TAILQ_REMOVE(&vsocket->conn_list, conn, next);
                pthread_mutex_unlock(&vsocket->conn_mutex);
 
                free(conn);
-
-               if (vsocket->reconnect) {
-                       create_unix_socket(vsocket);
-                       vhost_user_start_client(vsocket);
-               }
        }
 }