summaryrefslogtreecommitdiffstats
path: root/sys/scsi/cd.c
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/cd.c
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/cd.c')
-rw-r--r--sys/scsi/cd.c4
1 files changed, 3 insertions, 1 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 *
OpenPOWER on IntegriCloud