From: Damjan Marion Date: Thu, 11 Sep 2014 22:25:08 +0000 (-0700) Subject: virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated X-Git-Tag: spdx-start~10371 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d68e2ae56b27026c4518a119f2ab53c9fe164c46;p=dpdk.git virtio: fix crash if VIRTIO_NET_F_CTRL_VQ is not negotiated If VIRTIO_NET_F_CTRL_VQ is not negotiated hw->cvq will be NULL Signed-off-by: Damjan Marion Acked-by: Changchun Ouyang Acked-by: Olivier Matz --- diff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c index 29c9ceada5..ad6401c97a 100644 --- a/lib/librte_pmd_virtio/virtio_rxtx.c +++ b/lib/librte_pmd_virtio/virtio_rxtx.c @@ -328,8 +328,10 @@ virtio_dev_cq_start(struct rte_eth_dev *dev) struct virtio_hw *hw = VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private); - virtio_dev_vring_start(hw->cvq, VTNET_CQ); - VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq); + if (hw->cvq) { + virtio_dev_vring_start(hw->cvq, VTNET_CQ); + VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq); + } } void