]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_vhost/vhost_user/fd_man.c
vhost: fix missed unlock
[dpdk.git] / lib / librte_vhost / vhost_user / fd_man.c
index d68b270a20112341377c9d2d5e69ce961f85aa06..087aaed6b8e8527812d6c25dd7cd2193c6d7fe02 100644 (file)
@@ -150,8 +150,10 @@ fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb wcb, void *dat)
 
        /* Find a free slot in the list. */
        i = fdset_find_free_slot(pfdset);
-       if (i == -1)
+       if (i == -1) {
+               pthread_mutex_unlock(&pfdset->fd_mutex);
                return -2;
+       }
 
        fdset_add_fd(pfdset, i, fd, rcb, wcb, dat);
        pfdset->num++;