From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC59745480; Mon, 17 Jun 2024 12:13:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD707402AC; Mon, 17 Jun 2024 12:13:45 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B702C4028B for ; Mon, 17 Jun 2024 12:13:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718619224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8htNnRwFJ3BtyJ7U8Jnc7TNRES2QLJCXWnrXcNsadA4=; b=DspG9jXCSMydJJphbWkZi1NBzidnsBGax962VoI9NnpPz0Hic/j07TX82BUrdotekMlS15 tgT22NES5EHSe5rl56MwJcUYWewwbEk3mL6uUD6XSTZ5Bi9/WqGCD+P6adk1aDEielLbKO rP4Sn7Sao6Q817sw5A19A+vLG9kJlUU= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-Vq2-bX3mNWOUkrvyGtWMBg-1; Mon, 17 Jun 2024 06:13:40 -0400 X-MC-Unique: Vq2-bX3mNWOUkrvyGtWMBg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DDB3F195609E; Mon, 17 Jun 2024 10:13:39 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.26]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 70FAB1956087; Mon, 17 Jun 2024 10:13:37 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, yux.jiang@intel.com, david.marchand@redhat.com, chenbox@nvidia.com Cc: Maxime Coquelin Subject: [PATCH] vhost: fix FD registration to the fdset Date: Mon, 17 Jun 2024 12:13:34 +0200 Message-ID: <20240617101334.211756-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Signed-off-by: Maxime Coquelin --- 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