Commit b30cdfc5 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

rt2x00: Clean up error handling of PCI queue DMA allocation.

When, for some reason, the rt2x00pci module fails to allocate DMA memory for
the queues, it tries to undo the complete initialization of the PCI device,
including freeing of the irq. This results in the following error in dmesg, as
the irq hadn't been requested yet:

[  78.123456] Trying to free already-free IRQ 17

Fix this by implementing proper error handling code, instead of just using the
full uninitialization function.
Signed-off-by: default avatarGertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ed499983
...@@ -314,13 +314,14 @@ int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev) ...@@ -314,13 +314,14 @@ int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev)
if (status) { if (status) {
ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n", ERROR(rt2x00dev, "IRQ %d allocation failed (error %d).\n",
pci_dev->irq, status); pci_dev->irq, status);
return status; goto exit;
} }
return 0; return 0;
exit: exit:
rt2x00pci_uninitialize(rt2x00dev); queue_for_each(rt2x00dev, queue)
rt2x00pci_free_queue_dma(rt2x00dev, queue);
return status; return status;
} }
......
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