diff options
author | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-01-23 23:14:32 +0000 |
---|---|---|
committer | Andy Fiddaman <omnios@citrus-it.co.uk> | 2020-01-24 23:49:13 +0000 |
commit | d851c23803d14c57f342f6cca648ec3bfb5ea9d1 (patch) | |
tree | 05b2a032d2b86e19f0837e57d2c8f6cf3ffbbd26 /usr | |
parent | 54cceed6fe59abfe2b58b5b1ef5bb12e652048fa (diff) | |
download | illumos-joyent-d851c23803d14c57f342f6cca648ec3bfb5ea9d1.tar.gz |
12246 pci_get_irq_routing_table() leaks under UEFI
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Matthias Scheler <mscheler@tintri.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/uts/i86pc/os/pci_bios.c | 6 |
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)); } } |