|
@@ -241,7 +241,7 @@ static void lg_notify(struct virtqueue *vq)
|
|
}
|
|
}
|
|
|
|
|
|
/* An extern declaration inside a C file is bad form. Don't do it. */
|
|
/* An extern declaration inside a C file is bad form. Don't do it. */
|
|
-extern void lguest_setup_irq(unsigned int irq);
|
|
|
|
|
|
+extern int lguest_setup_irq(unsigned int irq);
|
|
|
|
|
|
/*
|
|
/*
|
|
* This routine finds the Nth virtqueue described in the configuration of
|
|
* This routine finds the Nth virtqueue described in the configuration of
|
|
@@ -304,7 +304,9 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
|
|
}
|
|
}
|
|
|
|
|
|
/* Make sure the interrupt is allocated. */
|
|
/* Make sure the interrupt is allocated. */
|
|
- lguest_setup_irq(lvq->config.irq);
|
|
|
|
|
|
+ err = lguest_setup_irq(lvq->config.irq);
|
|
|
|
+ if (err)
|
|
|
|
+ goto destroy_vring;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Tell the interrupt for this virtqueue to go to the virtio_ring
|
|
* Tell the interrupt for this virtqueue to go to the virtio_ring
|
|
@@ -317,7 +319,7 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
|
|
err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED,
|
|
err = request_irq(lvq->config.irq, vring_interrupt, IRQF_SHARED,
|
|
dev_name(&vdev->dev), vq);
|
|
dev_name(&vdev->dev), vq);
|
|
if (err)
|
|
if (err)
|
|
- goto destroy_vring;
|
|
|
|
|
|
+ goto free_desc;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Last of all we hook up our 'struct lguest_vq_info" to the
|
|
* Last of all we hook up our 'struct lguest_vq_info" to the
|
|
@@ -326,6 +328,8 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
|
|
vq->priv = lvq;
|
|
vq->priv = lvq;
|
|
return vq;
|
|
return vq;
|
|
|
|
|
|
|
|
+free_desc:
|
|
|
|
+ irq_free_desc(lvq->config.irq);
|
|
destroy_vring:
|
|
destroy_vring:
|
|
vring_del_virtqueue(vq);
|
|
vring_del_virtqueue(vq);
|
|
unmap:
|
|
unmap:
|