patch-2.3.99-pre3 linux/drivers/scsi/scsi.c

Next file: linux/drivers/scsi/st.c
Previous file: linux/drivers/scsi/qlogicisp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre2/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
@@ -1377,12 +1377,12 @@
  */
 void scsi_release_commandblocks(Scsi_Device * SDpnt)
 {
-	Scsi_Cmnd *SCpnt;
+	Scsi_Cmnd *SCpnt, *SCnext;
 	unsigned long flags;
 
-	spin_lock_irqsave(&device_request_lock, flags);
-	for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCpnt->next) {
-		SDpnt->device_queue = SCpnt->next;
+ 	spin_lock_irqsave(&device_request_lock, flags);
+	for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCnext) {
+		SDpnt->device_queue = SCnext = SCpnt->next;
 		kfree((char *) SCpnt);
 	}
 	SDpnt->has_cmdblocks = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)