Add M_ZERO to malloc calls where the result is just bzeroed.
PR: 22188 Submitted (partially) by: josh@zipperup.org
This commit is contained in:
parent
e5956e089e
commit
1e582e5548
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user