DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
@ 2018-02-03 14:55 David C Harton
  2018-02-05  8:17 ` Olivier Matz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David C Harton @ 2018-02-03 14:55 UTC (permalink / raw)
  To: yliu, maxime.coquelin, tiwei.bie; +Cc: dev, David C Harton, olivier.matz

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)
-- 
2.10.3.dirty

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-05 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-03 14:55 [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs David C Harton
2018-02-05  8:17 ` Olivier Matz
2018-02-05  8:44 ` Maxime Coquelin
2018-02-05 18:52 ` Ferruh Yigit

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).