From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4BDA22931 for ; Fri, 21 Oct 2016 09:51:36 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 21 Oct 2016 00:51:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,375,1473145200"; d="scan'208";a="1047895606" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 21 Oct 2016 00:51:34 -0700 Date: Fri, 21 Oct 2016 15:52:27 +0800 From: Yuanhan Liu To: dev@dpdk.org Cc: John McNamara Message-ID: <20161021075227.GS16751@yliu-dev.sh.intel.com> References: <1476801486-4618-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476801486-4618-1-git-send-email-yuanhan.liu@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: fix use after free issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 07:51:37 -0000 On Tue, Oct 18, 2016 at 10:38:06PM +0800, Yuanhan Liu wrote: > Fix the coverity USE_AFTER_FREE issue. > > Fixes: a277c7159876 ("vhost: refactor code structure") > Coverity issue: 137884 > > Reported-by: John McNamara > Signed-off-by: Yuanhan Liu Applied to dpdk-next-virtio. --yliu > --- > lib/librte_vhost/socket.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c > index 967cb65..aaa9c27 100644 > --- a/lib/librte_vhost/socket.c > +++ b/lib/librte_vhost/socket.c > @@ -250,8 +250,8 @@ vhost_user_read_cb(int connfd, void *dat, int *remove) > vsocket->connfd = -1; > close(connfd); > *remove = 1; > - free(conn); > vhost_destroy_device(conn->vid); > + free(conn); > > if (vsocket->reconnect) > vhost_user_create_client(vsocket); > -- > 1.9.0