From c56db4c78ab571bc91840bb8a394911b9d15e7ee Mon Sep 17 00:00:00 2001 From: rgrimes Date: Mon, 20 Sep 1993 06:27:06 +0000 Subject: 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 --- sys/scsi/cd.c | 4 +++- sys/scsi/sd.c | 4 +++- sys/scsi/st.c | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/scsi') 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 * \*******************************************************/ -- cgit v1.1