From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ouyang, Changchun" Subject: Re: [PATCH] examples/vhost: fix segfault when link_vmdq fails Date: Fri, 30 Jan 2015 07:57:17 +0000 Message-ID: References: <1422602016-12662-1-git-send-email-huawei.xie@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: "Xie, Huawei" , "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: <1422602016-12662-1-git-send-email-huawei.xie-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Huawei Xie > Sent: Friday, January 30, 2015 3:14 PM > To: dev-VfR2kkLFssw@public.gmane.org > Subject: [dpdk-dev] [PATCH] examples/vhost: fix segfault when link_vmdq > fails >=20 > Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang > --- > examples/vhost/main.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/examples/vhost/main.c b/examples/vhost/main.c index > 04f0118..3a35359 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -1308,8 +1308,8 @@ switch_worker(__attribute__((unused)) void *arg) > /* If this is the first received packet we need > to learn the MAC and setup VMDQ */ > if (unlikely(vdev->ready =3D=3D > DEVICE_MAC_LEARNING) && tx_count) { > if (vdev->remove || > (link_vmdq(vdev, pkts_burst[0]) =3D=3D -1)) { > - while (tx_count--) > - > rte_pktmbuf_free(pkts_burst[tx_count]); > + while (tx_count) > + > rte_pktmbuf_free(pkts_burst[--tx_count]); > } > } > while (tx_count) > -- > 1.8.1.4