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

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

diff -u --recursive --new-file v2.3.32/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
@@ -981,8 +981,10 @@
 
     SCSI_LOG_TIMEOUT(3, printk("sg_init\n"));
     sg_dev_arr = (Sg_device *)
-        scsi_init_malloc((sg_template.dev_noticed + SG_EXTRA_DEVS)
-                         * sizeof(Sg_device), GFP_ATOMIC);
+	kmalloc((sg_template.dev_noticed + SG_EXTRA_DEVS)
+		* sizeof(Sg_device), GFP_ATOMIC);
+    memset(sg_dev_arr, 0, (sg_template.dev_noticed + SG_EXTRA_DEVS)
+		* sizeof(Sg_device));
     if (NULL == sg_dev_arr) {
         printk("sg_init: no space for sg_dev_arr\n");
         return 1;
@@ -1085,9 +1087,7 @@
     if(sg_dev_arr != NULL) {
 /* Really worrying situation of writes still pending and get here */
 /* Strategy: shorten timeout on release + wait on detach ... */
-        scsi_init_free((char *) sg_dev_arr,
-                       (sg_template.dev_noticed + SG_EXTRA_DEVS)
-                       * sizeof(Sg_device));
+	kfree((char *) sg_dev_arr);
         sg_dev_arr = NULL;
     }
     sg_template.dev_max = 0;

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