diff options
author | jhb <jhb@FreeBSD.org> | 2006-07-10 19:28:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-07-10 19:28:57 +0000 |
commit | d05d04f2c786d4e6068f5c711643e3d3fb733608 (patch) | |
tree | f3be5ca31fa3699c4bbba886301d2de15c360b05 /sys/kern | |
parent | 401a0eaea0c790a2f0ab4f8948cb5a31d823f445 (diff) | |
download | FreeBSD-src-d05d04f2c786d4e6068f5c711643e3d3fb733608.zip FreeBSD-src-d05d04f2c786d4e6068f5c711643e3d3fb733608.tar.gz |
Explicitly use STAILQ_REMOVE_HEAD() when we know we are removing the head
element to avoid confusing Coverity. It's now also easier for humans to
parse as well.
Found by: Coverity Prevent(tm)
CID: 1201
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_linker.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 55ad60e..026d5b6 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -620,9 +620,8 @@ linker_file_unload(linker_file_t file, int flags) free(file->deps, M_LINKER); file->deps = NULL; } - for (cp = STAILQ_FIRST(&file->common); cp; - cp = STAILQ_FIRST(&file->common)) { - STAILQ_REMOVE(&file->common, cp, common_symbol, link); + while ((cp = STAILQ_FIRST(&file->common)) != NULL) { + STAILQ_REMOVE_HEAD(&file->common, link); free(cp, M_LINKER); } |