diff options
author | cg <cg@FreeBSD.org> | 2001-06-18 19:58:03 +0000 |
---|---|---|
committer | cg <cg@FreeBSD.org> | 2001-06-18 19:58:03 +0000 |
commit | 54d21ac4dad21c08c1895a79826856fe9b61756b (patch) | |
tree | f2375c4f8edc2dcbe9e3c9ac544dccef350368f5 /sys/dev/sound | |
parent | 1852c170852e451149bbb23f05c90310f707a739 (diff) | |
download | FreeBSD-src-54d21ac4dad21c08c1895a79826856fe9b61756b.zip FreeBSD-src-54d21ac4dad21c08c1895a79826856fe9b61756b.tar.gz |
stop csa from panicing in clkrun_hack() - we were using free'd memory
don't leak memory in clkrun_hack()
Submitted by: grog (partially)
Diffstat (limited to 'sys/dev/sound')
-rw-r--r-- | sys/dev/sound/pci/csa.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index 30957c3..6f8b732 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -125,9 +125,6 @@ clkrun_hack(int run) device_get_children(*busp, &pci_children, &pci_childcount); for (j = 0, childp = pci_children; j < pci_childcount; j++, childp++) { if (pci_get_vendor(*childp) == 0x8086 && pci_get_device(*childp) == 0x7113) { - free(pci_devices, M_TEMP); - free(pci_children, M_TEMP); - port = (pci_read_config(*childp, 0x41, 1) << 8) + 0x10; /* XXX */ btag = I386_BUS_SPACE_IO; @@ -136,13 +133,15 @@ clkrun_hack(int run) control &= ~0x2000; control |= run? 0 : 0x2000; bus_space_write_2(btag, 0x0, port, control); + free(pci_devices, M_TEMP); + free(pci_children, M_TEMP); return 0; } } + free(pci_children, M_TEMP); } free(pci_devices, M_TEMP); - free(pci_children, M_TEMP); return ENXIO; #else return 0; |