From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 2E1ABA0555;
	Wed, 19 Feb 2020 04:06:05 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 0896F1C07F;
	Wed, 19 Feb 2020 04:06:05 +0100 (CET)
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 13D922952
 for <dev@dpdk.org>; Wed, 19 Feb 2020 04:06:02 +0100 (CET)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 18 Feb 2020 19:06:02 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.70,459,1574150400"; d="scan'208";a="253954793"
Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74])
 by orsmga002.jf.intel.com with ESMTP; 18 Feb 2020 19:06:00 -0800
Date: Wed, 19 Feb 2020 11:05:50 +0800
From: Tiwei Bie <tiwei.bie@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, oda@valinux.co.jp, yinan.wang@intel.com,
 amorenoz@redhat.com, david.marchand@redhat.com
Message-ID: <20200219030550.GA973771@___>
References: <20200218172240.558516-1-maxime.coquelin@redhat.com>
 <20200218172240.558516-2-maxime.coquelin@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20200218172240.558516-2-maxime.coquelin@redhat.com>
User-Agent: Mutt/1.9.4 (2018-02-28)
Subject: Re: [dpdk-dev] [PATCH 1/2] net/vhost: fix Vhost setup error path
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Tue, Feb 18, 2020 at 06:22:39PM +0100, Maxime Coquelin wrote:
> If for some reason vhost_driver_setup() fails, the list
> element for the device may be freed without being removed
> from the internal list of devices.
> 
> This patch fixes all the error paths, by unregistering the
> device from Vhost library it has been registered, remove
> the device from the list, reset device vring_state pointer
> from the global table and only free vring state if it had
> been allocated.
> 
> Fixes: 3d01b759d267 ("net/vhost: delay driver setup")
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> ---
>  drivers/net/vhost/rte_eth_vhost.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

Thanks,
Tiwei