From: Huawei Xie Date: Thu, 10 Dec 2015 17:57:19 +0000 (+0800) Subject: vhost: fix missed unlock X-Git-Tag: spdx-start~7767 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=16321f1caa492bf51c4f057d4793fcb888f1ef0d;p=dpdk.git vhost: fix missed unlock CID 107113 (#1 of 1): Missing unlock (LOCK)5. missing_unlock: Returning without unlocking pfdset->fd_mutex. Fixes: fbf7e07ca142 ("vhost: add select based event driven processing") Signed-off-by: Huawei Xie Acked-by: John McNamara --- diff --git a/lib/librte_vhost/vhost_user/fd_man.c b/lib/librte_vhost/vhost_user/fd_man.c index d68b270a20..087aaed6b8 100644 --- a/lib/librte_vhost/vhost_user/fd_man.c +++ b/lib/librte_vhost/vhost_user/fd_man.c @@ -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++;