mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
stop csa from panicing in clkrun_hack() - we were using free'd memory
don't leak memory in clkrun_hack() Submitted by: grog (partially)
This commit is contained in:
parent
6fad32afc9
commit
b30d115684
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78429
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user