patch-2.3.40 linux/drivers/scsi/scsi_lib.c

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

diff -u --recursive --new-file v2.3.39/linux/drivers/scsi/scsi_lib.c linux/drivers/scsi/scsi_lib.c
@@ -947,23 +947,23 @@
 			 * get those allocated here.  
 			 */
 			if (!SDpnt->scsi_init_io_fn(SCpnt)) {
-				SHpnt->host_busy--;
-				SDpnt->device_busy--;
 				scsi_end_request(SCpnt, 0, 
 						 SCpnt->request.nr_sectors);
 				spin_lock_irq(&io_request_lock);
+				SHpnt->host_busy--;
+				SDpnt->device_busy--;
 				continue;
 			}
 			/*
 			 * Initialize the actual SCSI command for this request.
 			 */
 			if (!STpnt->init_command(SCpnt)) {
-				SHpnt->host_busy--;
-				SDpnt->device_busy--;
 				scsi_release_buffers(SCpnt);
 				scsi_end_request(SCpnt, 0, 
 						 SCpnt->request.nr_sectors);
 				spin_lock_irq(&io_request_lock);
+				SHpnt->host_busy--;
+				SDpnt->device_busy--;
 				continue;
 			}
 		}

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