Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2006 17:47:16 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 110957 for review
Message-ID:  <200612031747.kB3HlGpR050153@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110957

Change 110957 by rdivacky@rdivacky_witten on 2006/12/03 17:46:16

	Use TAILQ_FOREACH_SAFE instead of unsafe variant in linsysfs_uninit
	because we are deleting the element we are using.

Affected files ...

.. //depot/projects/linuxolator/src/sys/compat/linsysfs/linsysfs.c#2 edit

Differences ...

==== //depot/projects/linuxolator/src/sys/compat/linsysfs/linsysfs.c#2 (text) ====

@@ -268,9 +268,10 @@
 static int
 linsysfs_uninit(PFS_INIT_ARGS)
 {
-	struct scsi_host_queue *scsi_host;
+	struct scsi_host_queue *scsi_host, *scsi_host_temp;
 
-	TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) {
+	TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, 
+	      scsi_host_temp) {
 		TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next);
 		free(scsi_host->path, M_TEMP);
 		free(scsi_host, M_TEMP);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612031747.kB3HlGpR050153>