patch-2.3.99-pre1 linux/drivers/scsi/scsi_lib.c

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

diff -u --recursive --new-file v2.3.51/linux/drivers/scsi/scsi_lib.c linux/drivers/scsi/scsi_lib.c
@@ -87,6 +87,7 @@
 	SCpnt->request.cmd = SPECIAL;
 	SCpnt->request.special = (void *) SCpnt;
 	SCpnt->request.q = NULL;
+	SCpnt->request.nr_segments = 0;
 
 	/*
 	 * We have the option of inserting the head or the tail of the queue.
@@ -155,6 +156,8 @@
 	q = &SRpnt->sr_device->request_queue;
 	SRpnt->sr_request.cmd = SPECIAL;
 	SRpnt->sr_request.special = (void *) SRpnt;
+	SRpnt->sr_request.q = NULL;
+	SRpnt->sr_request.nr_segments = 0;
 
 	/*
 	 * We have the option of inserting the head or the tail of the queue.
@@ -909,6 +912,9 @@
 			 * be in an interrupt handler.  Only do this
 			 * from user space, since we do not want to
 			 * sleep from an interrupt.
+			 *
+			 * FIXME(eric) - have the error handler thread do
+			 * this work.
 			 */
 			SDpnt->was_reset = 0;
 			if (SDpnt->removable && !in_interrupt()) {
@@ -950,6 +956,9 @@
 			if( SRpnt->sr_magic == SCSI_REQ_MAGIC ) {
 				SCpnt = scsi_allocate_device(SRpnt->sr_device, 
 							     FALSE, FALSE);
+				if( !SCpnt ) {
+					break;
+				}
 				scsi_init_cmd_from_req(SCpnt, SRpnt);
 			}
 

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