diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index d9f06fbfa0bf..628c14150d49 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -439,8 +439,14 @@ static int msix_capability_init(struct pci_dev *dev, | |||
439 | 439 | ||
440 | for (i = 0; i < nvec; i++) { | 440 | for (i = 0; i < nvec; i++) { |
441 | entry = alloc_msi_entry(dev); | 441 | entry = alloc_msi_entry(dev); |
442 | if (!entry) | 442 | if (!entry) { |
443 | break; | 443 | if (!i) |
444 | iounmap(base); | ||
445 | else | ||
446 | msi_free_irqs(dev); | ||
447 | /* No enough memory. Don't try again */ | ||
448 | return -ENOMEM; | ||
449 | } | ||
444 | 450 | ||
445 | j = entries[i].entry; | 451 | j = entries[i].entry; |
446 | entry->msi_attrib.is_msix = 1; | 452 | entry->msi_attrib.is_msix = 1; |