summaryrefslogtreecommitdiffstats
path: root/loader/loader.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-07-19 02:09:10 +0000
committerErik Troan <ewt@redhat.com>1999-07-19 02:09:10 +0000
commit7ed8488db0acde7a732c4f5281b318e1dfe91b81 (patch)
tree303cf7d985d583835ab35c2a7b500eb435d37cb4 /loader/loader.c
parent61d01a7ad426852a9d051e581611bdd2b820d2f9 (diff)
downloadanaconda-7ed8488db0acde7a732c4f5281b318e1dfe91b81.tar.gz
anaconda-7ed8488db0acde7a732c4f5281b318e1dfe91b81.tar.xz
anaconda-7ed8488db0acde7a732c4f5281b318e1dfe91b81.zip
1) free pci device list properly
2) walk probed device list properly
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/loader/loader.c b/loader/loader.c
index f5448ee72..cc3f7f6b4 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -298,7 +298,7 @@ int findScsiList(void) {
}
static int detectHardware(struct moduleInfo *** modules) {
- struct pciDevice **devices, *device;
+ struct pciDevice **devices, **device;
struct moduleInfo * mod, ** modList;
int numMods, i;
@@ -317,8 +317,8 @@ static int detectHardware(struct moduleInfo *** modules) {
modList = malloc(sizeof(*modList) * 50); /* should be enough */
numMods = 0;
- while ((device = *devices++)) {
- if ((mod = isysFindModuleInfo(device->driver))) {
+ for (device = devices; *device; device++) {
+ if ((mod = isysFindModuleInfo((*device)->driver))) {
for (i = 0; i < numMods; i++)
if (modList[i] == mod) break;
if (i == numMods)
@@ -328,7 +328,7 @@ static int detectHardware(struct moduleInfo *** modules) {
if (numMods) {
*modules = modList;
- modList[numMods]->moduleName = NULL;
+ modList[numMods] = NULL;
} else {
free(modList);
*modules = NULL;
@@ -390,8 +390,7 @@ int main(int argc, char ** argv) {
sleep(5);
exit(1);
} else if (modList) {
- printf("here\n");
- for (i = 0; modList[i]->moduleName; i++)
+ for (i = 0; modList[i]; i++)
printf("should try %s\n", modList[i]->moduleName);
}
}