A missing return statement in fdset_add() was making
the error path to be systematically executed, this patch
adds it back.
Bugzilla ID: 1462
Fixes: 0e38b42bf61c ("vhost: manage FD with epoll")
Reported-by: Jiang Yu <[email protected]>
Signed-off-by: Maxime Coquelin <[email protected]>
---
lib/vhost/fd_man.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 12c0f2c2b3..87a8dc3f3e 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -242,6 +242,7 @@ fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb
wcb, void *dat)
goto out_remove;
}
+ return 0;
out_remove:
pthread_mutex_lock(&pfdset->fd_mutex);
pfdentry = fdset_find_entry_locked(pfdset, fd);
--
2.45.1