diff options
author | netchild <netchild@FreeBSD.org> | 2006-12-03 21:00:31 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2006-12-03 21:00:31 +0000 |
commit | 05483cfbc2deab0d4786fd0495b74142cecf30fc (patch) | |
tree | bfdff3359a4ea814c5e1dccdeb0341cb0801d46c /sys/compat/linsysfs | |
parent | 782cf0f37f7f5ef3a120b8093bd00fd8115109b3 (diff) | |
download | FreeBSD-src-05483cfbc2deab0d4786fd0495b74142cecf30fc.zip FreeBSD-src-05483cfbc2deab0d4786fd0495b74142cecf30fc.tar.gz |
MFP4 (110957)
Use TAILQ_FOREACH_SAFE instead of the unsafe one where an item is removed
from the queue.
This prevents a panic on kldunload.
Submitted by: rdivacky
Tested by: bsam
Diffstat (limited to 'sys/compat/linsysfs')
-rw-r--r-- | sys/compat/linsysfs/linsysfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c index 60a9479..cce49f7 100644 --- a/sys/compat/linsysfs/linsysfs.c +++ b/sys/compat/linsysfs/linsysfs.c @@ -268,9 +268,10 @@ linsysfs_init(PFS_INIT_ARGS) static int linsysfs_uninit(PFS_INIT_ARGS) { - struct scsi_host_queue *scsi_host; + struct scsi_host_queue *scsi_host, *scsi_host_tmp; - TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) { + TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, + scsi_host_tmp) { TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next); free(scsi_host->path, M_TEMP); free(scsi_host, M_TEMP); |