diff options
author | Warner Losh <imp@FreeBSD.org> | 2008-08-23 15:34:31 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2008-08-23 15:34:31 +0000 |
commit | 3106346290de7e66d8174a3cd9ee06d34e1f6668 (patch) | |
tree | 47e0c0d195a0f372c104b0233c9dbabe67590fa0 /sys/dev/sis | |
parent | 373444e7a1dcc6a0d93e0b61b998a85fa3c4e158 (diff) | |
download | src-test2-3106346290de7e66d8174a3cd9ee06d34e1f6668.tar.gz src-test2-3106346290de7e66d8174a3cd9ee06d34e1f6668.zip |
Notes
Diffstat (limited to 'sys/dev/sis')
-rw-r--r-- | sys/dev/sis/if_sis.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c index e5292ebf5e3d..90cd430ab683 100644 --- a/sys/dev/sis/if_sis.c +++ b/sys/dev/sis/if_sis.c @@ -347,21 +347,22 @@ sis_find_bridge(device_t dev) devclass_get_devices(pci_devclass, &pci_devices, &pci_count); for (i = 0, busp = pci_devices; i < pci_count; i++, busp++) { - pci_childcount = 0; - device_get_children(*busp, &pci_children, &pci_childcount); + if (device_get_children(*busp, &pci_children, &pci_childcount)) + continue; for (j = 0, childp = pci_children; j < pci_childcount; j++, childp++) { if (pci_get_vendor(*childp) == SIS_VENDORID && pci_get_device(*childp) == 0x0008) { child = *childp; + free(pci_children, M_TEMP); goto done; } } + free(pci_children, M_TEMP); } done: free(pci_devices, M_TEMP); - free(pci_children, M_TEMP); return(child); } |