vhost: fix missed unlock

CID 107113 (#1 of 1): Missing unlock (LOCK)5. missing_unlock: Returning
without unlocking pfdset->fd_mutex.
Fixes: fbf7e07ca1 ("vhost: add select based event driven processing")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
This commit is contained in:
Huawei Xie 2015-12-11 01:57:19 +08:00 committed by Thomas Monjalon
parent 3b77b90e34
commit 16321f1caa

View 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++;