diff options
author | imp <imp@FreeBSD.org> | 2015-03-01 21:41:35 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2015-03-01 21:41:35 +0000 |
commit | 9baadf23b3c5bd9a8c6df43581f747cb9449fa1b (patch) | |
tree | dcab3f654ef11a8061cb32cc68f46dcd1904276d /sys/dev/pci/pci.c | |
parent | 8ff07022700e29f1e74bba3ee4ca6329d17dbff7 (diff) | |
download | FreeBSD-src-9baadf23b3c5bd9a8c6df43581f747cb9449fa1b.zip FreeBSD-src-9baadf23b3c5bd9a8c6df43581f747cb9449fa1b.tar.gz |
Don't leak 'used' in a few error cases.
Reported by: Maxime Villard
Diffstat (limited to 'sys/dev/pci/pci.c')
-rw-r--r-- | sys/dev/pci/pci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index b106c67..3fab486 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1702,12 +1702,16 @@ pci_remap_msix_method(device_t dev, device_t child, int count, for (i = 0; i < msix->msix_table_len; i++) { if (msix->msix_table[i].mte_vector == 0) continue; - if (msix->msix_table[i].mte_handlers > 0) + if (msix->msix_table[i].mte_handlers > 0) { + free(used, M_DEVBUF); return (EBUSY); + } rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, i + 1); KASSERT(rle != NULL, ("missing resource")); - if (rle->res != NULL) + if (rle->res != NULL) { + free(used, M_DEVBUF); return (EBUSY); + } } /* Free the existing resource list entries. */ |