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 6C690A0A0B; Mon, 1 Feb 2021 10:33:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F22C316065F; Mon, 1 Feb 2021 10:33:32 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 3BC4140693 for ; Mon, 1 Feb 2021 10:33:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612172010; 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=5vTVnwt+o12hZGhRWDBAnxb6WbTk0bQ/ypKXutfjbnw=; b=RV4oEFb21omLCIgegAEqPEqnVFjWPiwY6PZlXQSdBDza+c8+DUJCsfatzFo8lpIl+9cC6s CacAmP/FdenwE4UtME5/neihIGl8ut5YGKCqDPXnRSYzZz702wQ3Ue/JQW+5K7ufmwFmI3 pdOPfhwxfUEr3Qg8uVR7CXpu0T03tcM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-8nuGmwVIN6u6KYkbrxpnqQ-1; Mon, 01 Feb 2021 04:33:29 -0500 X-MC-Unique: 8nuGmwVIN6u6KYkbrxpnqQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CC2C107ACE3; Mon, 1 Feb 2021 09:33:27 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBBBD60C64; Mon, 1 Feb 2021 09:33:19 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, yinan.wang@intel.com, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, weix.ling@intel.com, yux.jiang@intel.com Cc: Maxime Coquelin , Jun W Zhou Date: Mon, 1 Feb 2021 10:33:17 +0100 Message-Id: <20210201093317.6761-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization 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 Sender: "dev" When running in client mode, the listen file descriptor is not initialized, and so has value 0. At destroy time, the listen FD is closed if its value is greater than or equal to zero, which causes STDIN to be closed. Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend") Bugzilla ID: 630 Reported-by: Jun W Zhou Signed-off-by: Maxime Coquelin --- drivers/net/virtio/virtio_user/vhost_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index ec2c53c8fb..f8569f6e6f 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -831,6 +831,7 @@ vhost_user_setup(struct virtio_user_dev *dev) dev->backend_data = data; data->vhostfd = -1; + data->listenfd = -1; fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) { -- 2.29.2