From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 688081B30B for ; Mon, 5 Feb 2018 09:44:59 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF7A7C036740; Mon, 5 Feb 2018 08:44:58 +0000 (UTC) Received: from [10.36.112.45] (ovpn-112-45.ams2.redhat.com [10.36.112.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E7F0620D8; Mon, 5 Feb 2018 08:44:56 +0000 (UTC) To: David C Harton , yliu@fridaylinux.org, tiwei.bie@intel.com Cc: dev@dpdk.org, olivier.matz@6wind.com References: <20180203145523.28013-1-dharton@cisco.com> From: Maxime Coquelin Message-ID: Date: Mon, 5 Feb 2018 09:44:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180203145523.28013-1-dharton@cisco.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Feb 2018 08:44:58 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 08:44:59 -0000 On 02/03/2018 03:55 PM, David C Harton wrote: > virtio_dev_free_mbufs was recently modified to free the > virtqueues but failed to check whether the array was > allocated. Added a check to ensure vqs was non-null. > > Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing") > Cc: olivier.matz@6wind.com > > Signed-off-by: David C Harton > --- > drivers/net/virtio/virtio_ethdev.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 2082d6a..884f74a 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1975,6 +1975,9 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev) > struct rte_mbuf *buf; > int queue_type; > > + if (hw->vqs == NULL) > + return; > + > for (i = 0; i < nr_vq; i++) { > vq = hw->vqs[i]; > if (!vq) > Reviewed-by: Maxime Coquelin Thanks, Maxime