summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/os/pci_bios.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc/os/pci_bios.c')
-rw-r--r--usr/src/uts/i86pc/os/pci_bios.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/uts/i86pc/os/pci_bios.c b/usr/src/uts/i86pc/os/pci_bios.c
index 4c824c695a..a24064b8cb 100644
--- a/usr/src/uts/i86pc/os/pci_bios.c
+++ b/usr/src/uts/i86pc/os/pci_bios.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -70,7 +71,7 @@ pci_bios_get_irq_routing(pci_irq_route_t *routes, int nroutes, int *nneededp)
struct bop_regs regs;
uchar_t *hdrp;
uchar_t *bufp;
- int i, n;
+ int i, n;
int rval = 0;
if (nneededp)
@@ -155,13 +156,14 @@ pci_get_irq_routing_table(void)
cmn_err(CE_CONT,
"pci: unable to get IRQ routing information, "
"required buffer space for %d entries\n", n);
- kmem_free(routes, n * sizeof (pci_irq_route_t));
}
}
if (nroutes > 0) {
pci_irq_routes = routes;
pci_irq_nroutes = nroutes;
+ } else {
+ kmem_free(routes, n * sizeof (pci_irq_route_t));
}
}