Commit 7f3da4b6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Juergen Gross

xen/events: fix error code in xen_bind_pirq_msi_to_irq()

Return -ENOMEM if xen_irq_init() fails.  currently the code returns an
uninitialized variable or zero.

Fixes: 5dd9ad32 ("xen/events: drop xen_allocate_irqs_dynamic()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarJuergen Gross <jgross@ssue.com>
Link: https://lore.kernel.org/r/3b9ab040-a92e-4e35-b687-3a95890a9ace@moroto.mountainSigned-off-by: default avatarJuergen Gross <jgross@suse.com>
parent db283230
......@@ -1110,8 +1110,10 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc,
for (i = 0; i < nvec; i++) {
info = xen_irq_init(irq + i);
if (!info)
if (!info) {
ret = -ENOMEM;
goto error_irq;
}
irq_set_chip_and_handler_name(irq + i, &xen_pirq_chip, handle_edge_irq, name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment