diff options
author | mjacob <mjacob@FreeBSD.org> | 2000-10-27 16:36:26 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2000-10-27 16:36:26 +0000 |
commit | 11f3b89daf85ef259923eb7b038364b4851c5aac (patch) | |
tree | 03b28a2fc70a5aa7dab59db054e53a9c96ea614e /sys | |
parent | 1df324d9d7ba19a700e88b7c0b40cd1f790674c6 (diff) | |
download | FreeBSD-src-11f3b89daf85ef259923eb7b038364b4851c5aac.zip FreeBSD-src-11f3b89daf85ef259923eb7b038364b4851c5aac.tar.gz |
Add M_ZERO to malloc calls where the result is just bzeroed.
PR: 22188
Submitted (partially) by: josh@zipperup.org
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/interrupt.c | 7 | ||||
-rw-r--r-- | sys/alpha/osf1/imgact_osf1.c | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 2df48a2..5a75fcb 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -371,11 +371,11 @@ alpha_setup_intr(const char *name, int vector, driver_intr_t *handler, if (ithd == NULL || ithd->it_ih == NULL) { /* first handler for this vector */ if (ithd == NULL) { - ithd = malloc(sizeof(struct ithd), M_DEVBUF, M_WAITOK); + ithd = malloc(sizeof(struct ithd), M_DEVBUF, + M_WAITOK | M_ZERO); if (ithd == NULL) return ENOMEM; - bzero(ithd, sizeof(struct ithd)); ithd->irq = vector; ithd->it_md = i; i->ithd = ithd; @@ -410,10 +410,9 @@ alpha_setup_intr(const char *name, int vector, driver_intr_t *handler, } /* Third, setup the interrupt descriptor for this handler. */ - idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK); + idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK | M_ZERO); if (idesc == NULL) return ENOMEM; - bzero(idesc, sizeof(struct intrhand)); idesc->ih_handler = handler; idesc->ih_argument = arg; diff --git a/sys/alpha/osf1/imgact_osf1.c b/sys/alpha/osf1/imgact_osf1.c index f88ab28..f7bf971 100644 --- a/sys/alpha/osf1/imgact_osf1.c +++ b/sys/alpha/osf1/imgact_osf1.c @@ -109,8 +109,7 @@ exec_osf1_imgact(struct image_params *imgp) printf("unknown ecoff magic %x\n", eap->magic); return ENOEXEC; } - osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_WAITOK); - bzero(osf_auxargs, sizeof(Osf_Auxargs)); + osf_auxargs = malloc(sizeof(Osf_Auxargs), M_TEMP, M_WAITOK | M_ZERO); imgp->auxargs = osf_auxargs; osf_auxargs->executable = osf_auxargs->exec_path; path_not_saved = copyinstr(imgp->fname, osf_auxargs->executable, @@ -226,8 +225,7 @@ exec_osf1_imgact(struct image_params *imgp) raw_dend = (eap->data_start + eap->dsize); if (dend > raw_dend) { caddr_t zeros; - zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK); - bzero(zeros,dend-raw_dend); + zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK|M_ZERO); if ((error = copyout(zeros, (caddr_t)raw_dend, dend-raw_dend))) { uprintf("Can't zero start of bss, error %d\n",error); |