patch-2.3.2 linux/drivers/scsi/sg.c

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

diff -u --recursive --new-file v2.3.1/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
@@ -1334,13 +1334,13 @@
         return sdp->headfp;
     }
     sfp = (Sg_fd *)sg_low_malloc(sizeof(Sg_fd), 0, SG_HEAP_KMAL, 0);
-    if (sfp) {
-        memset(sfp, 0, sizeof(Sg_fd));
-        sfp->my_mem_src = SG_HEAP_KMAL;
-    }
-    else
-        return NULL;
-        
+    if (!sfp)
+	return NULL;
+
+    memset(sfp, 0, sizeof(Sg_fd));
+    sfp->my_mem_src = SG_HEAP_KMAL;
+
+    init_waitqueue_head(&sfp->read_wait);    
     sfp->timeout = SG_DEFAULT_TIMEOUT;
     sfp->force_packid = SG_DEF_FORCE_PACK_ID;
     sfp->low_dma = (SG_DEF_FORCE_LOW_DMA == 0) ?

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