summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1993-09-20 06:27:06 +0000
committerrgrimes <rgrimes@FreeBSD.org>1993-09-20 06:27:06 +0000
commitc56db4c78ab571bc91840bb8a394911b9d15e7ee (patch)
treef8c5b0f4d0503f6438e340adc93b9a4695987d6d /sys/scsi
parenta1c237516c73326d5fb4f1324a5d18483baaf8e0 (diff)
downloadFreeBSD-src-c56db4c78ab571bc91840bb8a394911b9d15e7ee.zip
FreeBSD-src-c56db4c78ab571bc91840bb8a394911b9d15e7ee.tar.gz
The dynamically allocated struct's where not getting properly initialized
as malloc memory is NOT zerod. Added bzero's after the malloc calls to make sure that things are initialized. >From Julian Elischer
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/cd.c4
-rw-r--r--sys/scsi/sd.c4
-rw-r--r--sys/scsi/st.c6
3 files changed, 10 insertions, 4 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 6d6a3d4..ab39386 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: cd.c,v 1.7 1993/09/08 21:04:32 rgrimes Exp $
+ * $Id: cd.c,v 1.8 1993/09/09 07:18:52 rgrimes Exp $
*/
#define SPLCD splbio
@@ -162,6 +162,7 @@ struct scsi_switch *scsi_switch;
return(0);
}
/* Make sure we have something to copy before we copy it */
+ bzero(cdrealloc,sizeof(cd_driver->cd_data) * next_cd_unit);
if(cd_driver->size)
{
bcopy(cd_driver->cd_data,cdrealloc,
@@ -187,6 +188,7 @@ struct scsi_switch *scsi_switch;
printf("cd%d: malloc failed for cd_data\n",unit);
return(0);
}
+ bzero(cd,sizeof(struct cd_data));
dp = &(cd->params);
/*******************************************************\
* Store information needed to contact our base driver *
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index e931b7a..c587e77 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
- * $Id: sd.c,v 1.7 1993/09/09 01:30:46 rgrimes Exp $
+ * $Id: sd.c,v 1.8 1993/09/10 18:03:21 ats Exp $
*/
#define SPLSD splbio
@@ -147,6 +147,8 @@ struct scsi_switch *scsi_switch;
printf("malloc failed in sd.c\n");
return(0);
}
+ bzero(sd,sizeof(struct sd_data));
+
dp = &(sd->params);
/*******************************************************\
* Store information needed to contact our base driver *
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index ed803c7..ea35b92 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -21,13 +21,13 @@
* 16 Feb 93 Julian Elischer ADDED for SCSI system
* 1.15 is the last verion to support MACH and OSF/1
*/
-/* $Revision: 1.7 $ */
+/* $Revision: 1.8 $ */
/*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
* major changes by Julian Elischer (julian@jules.dialix.oz.au) May 1993
*
- * $Id: st.c,v 1.7 1993/09/05 15:42:22 rgrimes Exp $
+ * $Id: st.c,v 1.8 1993/09/07 15:58:00 rgrimes Exp $
*/
@@ -255,6 +255,8 @@ struct scsi_switch *scsi_switch;
printf("st%d: malloc failed in st.c\n",unit);
return(0);
}
+ bzero(st,sizeof(struct st_data));
+
/*******************************************************\
* Store information needed to contact our base driver *
\*******************************************************/
OpenPOWER on IntegriCloud