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 <damarion@cisco.com> Acked-by: Changchun Ouyang <Changchun.ouyang@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
parent
e88c3b0a59
commit
d68e2ae56b
@ -328,8 +328,10 @@ virtio_dev_cq_start(struct rte_eth_dev *dev)
|
|||||||
struct virtio_hw *hw
|
struct virtio_hw *hw
|
||||||
= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);
|
||||||
|
|
||||||
virtio_dev_vring_start(hw->cvq, VTNET_CQ);
|
if (hw->cvq) {
|
||||||
VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
|
virtio_dev_vring_start(hw->cvq, VTNET_CQ);
|
||||||
|
VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user