From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs Date: Mon, 5 Feb 2018 09:44:54 +0100 Message-ID: References: <20180203145523.28013-1-dharton@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, olivier.matz@6wind.com To: David C Harton , yliu@fridaylinux.org, tiwei.bie@intel.com 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) In-Reply-To: <20180203145523.28013-1-dharton@cisco.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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