DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David C Harton <dharton@cisco.com>,
	yliu@fridaylinux.org, tiwei.bie@intel.com
Cc: dev@dpdk.org, olivier.matz@6wind.com
Subject: Re: [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
Date: Mon, 5 Feb 2018 09:44:54 +0100	[thread overview]
Message-ID: <aaaeb438-3a08-a7f2-e5f3-0a1699a23a3e@redhat.com> (raw)
In-Reply-To: <20180203145523.28013-1-dharton@cisco.com>



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 <dharton@cisco.com>
> ---
>   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 <maxime.coquelin@redhat.com>

Thanks,
Maxime

  parent reply	other threads:[~2018-02-05  8:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-03 14:55 David C Harton
2018-02-05  8:17 ` Olivier Matz
2018-02-05  8:44 ` Maxime Coquelin [this message]
2018-02-05 18:52 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaaeb438-3a08-a7f2-e5f3-0a1699a23a3e@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dharton@cisco.com \
    --cc=olivier.matz@6wind.com \
    --cc=tiwei.bie@intel.com \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).