diff options
author | jhb <jhb@FreeBSD.org> | 2006-07-10 19:06:01 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-07-10 19:06:01 +0000 |
commit | 3f18ce7ca9b8c6fe526866df69d3bca30948cabc (patch) | |
tree | 08af52a65b8ab5f86e8a4de7fde1bf47bb4887ad /sys/kern/kern_linker.c | |
parent | 0e6d9ac511b86d776777249e8dbc52878edb3aa0 (diff) | |
download | FreeBSD-src-3f18ce7ca9b8c6fe526866df69d3bca30948cabc.zip FreeBSD-src-3f18ce7ca9b8c6fe526866df69d3bca30948cabc.tar.gz |
Don't try to reuse the linker_file structure after we've freed it when
throwing out the kld's loaded by the loader that didn't successfully link.
Found by: Coverity Prevent(tm)
CID: 1435
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r-- | sys/kern/kern_linker.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 5182803..0aeb21c 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1409,10 +1409,10 @@ restart: /* * At this point, we check to see what could not be resolved.. */ - TAILQ_FOREACH(lf, &loaded_files, loaded) { + while ((lf = TAILQ_FIRST(&loaded_files)) != NULL) { + TAILQ_REMOVE(&loaded_files, lf, loaded); printf("KLD file %s is missing dependencies\n", lf->filename); linker_file_unload(lf, LINKER_UNLOAD_FORCE); - TAILQ_REMOVE(&loaded_files, lf, loaded); } /* |