vhost: fix FD registration to the fdset
Checks
Commit Message
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 <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/vhost/fd_man.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Mon, Jun 17, 2024 at 12:13 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> 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")
It looks like the initial code was better ;-).
>
> Reported-by: Jiang Yu <yux.jiang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Applied directly in main for rc1, thanks.
@@ -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);