if input parameter vq is NULL, hw = vq->hw, causes a segmentation fault.
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Fixed io permission in the interrupt handler.
+* **virtio: Fixed crash when releasing queue.**
+
+ Fixed issue when releasing null control queue.
+
Libraries
~~~~~~~~~
void
virtio_dev_queue_release(struct virtqueue *vq) {
- struct virtio_hw *hw = vq->hw;
+ struct virtio_hw *hw;
if (vq) {
+ hw = vq->hw;
/* Select and deactivate the queue */
VIRTIO_WRITE_REG_2(hw, VIRTIO_PCI_QUEUE_SEL, vq->queue_id);
VIRTIO_WRITE_REG_4(hw, VIRTIO_PCI_QUEUE_PFN, 0);