1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-29 16:44:03 +00:00

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
This commit is contained in:
Rodney W. Grimes 1993-09-20 06:27:06 +00:00
parent 3bef766f61
commit 968d6ea058
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=485
3 changed files with 10 additions and 4 deletions

View File

@ -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 *

View File

@ -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 *

View File

@ -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 *
\*******************************************************/