diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2000-12-08 21:51:06 +0000 |
commit | dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch) | |
tree | 197ae73617ae75afe008897f6906b84835589ea2 /sys/i386 | |
parent | ed5dbfbd3cd619638a7baac288f548aa1398edac (diff) | |
download | FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.zip FreeBSD-src-dd75d1d73b4f3034c1d9f621a49fff58b1d71eb1.tar.gz |
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/busdma_machdep.c | 16 | ||||
-rw-r--r-- | sys/i386/i386/i686_mem.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/k6_mem.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/legacy.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/nexus.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/userconfig.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 3 | ||||
-rw-r--r-- | sys/i386/isa/bs/bsfunc.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/bs/bsif.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/cy.c | 3 | ||||
-rw-r--r-- | sys/i386/isa/if_ar.c | 11 | ||||
-rw-r--r-- | sys/i386/isa/if_sr.c | 15 | ||||
-rw-r--r-- | sys/i386/isa/intr_machdep.c | 7 | ||||
-rw-r--r-- | sys/i386/isa/isa_compat.c | 3 | ||||
-rw-r--r-- | sys/i386/isa/istallion.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/nmi.c | 7 | ||||
-rw-r--r-- | sys/i386/isa/rp.c | 12 | ||||
-rw-r--r-- | sys/i386/isa/stallion.c | 16 |
18 files changed, 47 insertions, 76 deletions
diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index 63c4038..9f0f7c37b 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -250,14 +250,13 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) int maxpages; *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT); - if (*mapp == NULL) { + M_NOWAIT | M_ZERO); + if (*mapp == NULL) return (ENOMEM); - } else { - /* Initialize the new map */ - bzero(*mapp, sizeof(**mapp)); - STAILQ_INIT(&((*mapp)->bpages)); - } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + /* * Attempt to add pages to our pool on a per-instance * basis up to a sane limit. @@ -551,11 +550,10 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) int s; bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (bpage == NULL) break; - bzero(bpage, sizeof(*bpage)); bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0ul, dmat->lowaddr, diff --git a/sys/i386/i386/i686_mem.c b/sys/i386/i386/i686_mem.c index 9d49949..c3929bc 100644 --- a/sys/i386/i386/i686_mem.c +++ b/sys/i386/i386/i686_mem.c @@ -522,8 +522,7 @@ i686_mrinit(struct mem_range_softc *sc) sc->mr_desc = (struct mem_range_desc *)malloc(nmdesc * sizeof(struct mem_range_desc), - M_MEMDESC, M_WAITOK); - bzero(sc->mr_desc, nmdesc * sizeof(struct mem_range_desc)); + M_MEMDESC, M_WAITOK | M_ZERO); sc->mr_ndesc = nmdesc; mrd = sc->mr_desc; diff --git a/sys/i386/i386/k6_mem.c b/sys/i386/i386/k6_mem.c index 48af3dd..00f9b7f 100644 --- a/sys/i386/i386/k6_mem.c +++ b/sys/i386/i386/k6_mem.c @@ -100,10 +100,9 @@ k6_mrinit(struct mem_range_softc *sc) { sc->mr_cap = 0; sc->mr_ndesc = 2; /* XXX (BFF) For now, we only have one msr for this */ sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), - M_MEMDESC, M_NOWAIT); + M_MEMDESC, M_NOWAIT | M_ZERO); if (sc->mr_desc == NULL) panic("k6_mrinit: malloc returns NULL"); - bzero(sc->mr_desc, sc->mr_ndesc * sizeof(struct mem_range_desc)); reg = rdmsr(UWCCR); for (d = 0; d < sc->mr_ndesc; d++) { diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c index d648848..76c41ae 100644 --- a/sys/i386/i386/legacy.c +++ b/sys/i386/i386/legacy.c @@ -331,10 +331,9 @@ nexus_add_child(device_t bus, int order, const char *name, int unit) device_t child; struct nexus_device *ndev; - ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT); + ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); if (!ndev) return(0); - bzero(ndev, sizeof(struct nexus_device)); resource_list_init(&ndev->nx_resources); ndev->nx_pcibus = -1; diff --git a/sys/i386/i386/nexus.c b/sys/i386/i386/nexus.c index d648848..76c41ae 100644 --- a/sys/i386/i386/nexus.c +++ b/sys/i386/i386/nexus.c @@ -331,10 +331,9 @@ nexus_add_child(device_t bus, int order, const char *name, int unit) device_t child; struct nexus_device *ndev; - ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT); + ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); if (!ndev) return(0); - bzero(ndev, sizeof(struct nexus_device)); resource_list_init(&ndev->nx_resources); ndev->nx_pcibus = -1; diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index de19c23..a8a80fa 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -3228,8 +3228,8 @@ load_devtab(void) char *name; int unit; - uc_devtab = malloc(sizeof(struct uc_device)*(count + 1),M_DEVL,M_WAITOK); - bzero(uc_devtab, sizeof(struct uc_device) * (count + 1)); + uc_devtab = malloc(sizeof(struct uc_device) * (count + 1), M_DEVL, + M_WAITOK | M_ZERO); dt = 0; for (i = 0; i < count; i++) { name = resource_query_name(i); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 294a583..dcf4986 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -287,11 +287,10 @@ cpu_coredump(p, vp, cred) int error; caddr_t tempuser; - tempuser = malloc(ctob(UPAGES), M_TEMP, M_WAITOK); + tempuser = malloc(ctob(UPAGES), M_TEMP, M_WAITOK | M_ZERO); if (!tempuser) return EINVAL; - bzero(tempuser, ctob(UPAGES)); bcopy(p->p_addr, tempuser, sizeof(struct user)); bcopy(p->p_md.md_regs, tempuser + ((caddr_t) p->p_md.md_regs - (caddr_t) p->p_addr), diff --git a/sys/i386/isa/bs/bsfunc.c b/sys/i386/isa/bs/bsfunc.c index 42a636f..8800d3d 100644 --- a/sys/i386/isa/bs/bsfunc.c +++ b/sys/i386/isa/bs/bsfunc.c @@ -682,15 +682,13 @@ bs_init_target_info(bsc, target) { struct targ_info *ti; - ti = malloc(sizeof(struct targ_info), M_DEVBUF, M_NOWAIT); + ti = malloc(sizeof(struct targ_info), M_DEVBUF, M_NOWAIT | M_ZERO); if (ti == NULL) { bs_printf(NULL, "bs_init_targ_info", "no target info memory"); return ti; } - bzero(ti, sizeof(*ti)); - ti->ti_bsc = bsc; ti->ti_id = target; ti->sm_offset = 0; diff --git a/sys/i386/isa/bs/bsif.c b/sys/i386/isa/bs/bsif.c index 743fb39..d48469d 100644 --- a/sys/i386/isa/bs/bsif.c +++ b/sys/i386/isa/bs/bsif.c @@ -153,11 +153,11 @@ bsprobe(dev) printf("bs%d: memory already allocated\n", unit); return rv; } - if (!(bsc = malloc(sizeof(struct bs_softc), M_TEMP, M_NOWAIT))) { + if (!(bsc = malloc(sizeof(struct bs_softc), M_TEMP, M_NOWAIT | M_ZERO))) + { printf("bs%d cannot malloc!\n", unit); return rv; } - bzero(bsc, sizeof(struct bs_softc)); callout_handle_init(&bsc->timeout_ch); bscdata[unit] = bsc; bsc->unit = unit; diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index 4006807..18245e3 100644 --- a/sys/i386/isa/cy.c +++ b/sys/i386/isa/cy.c @@ -553,10 +553,9 @@ cyattach_common(cy_iobase, cy_align) struct com_s *com; int s; - com = malloc(sizeof *com, M_DEVBUF, M_NOWAIT); + com = malloc(sizeof *com, M_DEVBUF, M_NOWAIT | M_ZERO); if (com == NULL) break; - bzero(com, sizeof *com); com->unit = unit; com->gfrcr_image = firmware_version; if (CY_RTS_DTR_SWAPPED(firmware_version)) { diff --git a/sys/i386/isa/if_ar.c b/sys/i386/isa/if_ar.c index dfbc3ac..9acc402 100644 --- a/sys/i386/isa/if_ar.c +++ b/sys/i386/isa/if_ar.c @@ -397,8 +397,7 @@ arattach_pci(int unit, vm_offset_t mem_addr) struct ar_hardc *hc; u_int i, tmp; - hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK); - bzero(hc, sizeof(struct ar_hardc)); + hc = malloc(sizeof(struct ar_hardc), M_DEVBUF, M_WAITOK | M_ZERO); hc->cunit = unit; hc->mem_start = (caddr_t)mem_addr; @@ -1139,11 +1138,10 @@ arc_init(struct ar_hardc *hc) u_int descneeded; u_char isr, mar; - MALLOC(sc, struct ar_softc *, - hc->numports * sizeof(struct ar_softc), M_DEVBUF, M_WAITOK); + MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc), + M_DEVBUF, M_WAITOK | M_ZERO); if (sc == NULL) return; - bzero(sc, hc->numports * sizeof(struct ar_softc)); hc->sc = sc; hc->txc_dtr[0] = AR_TXC_DTR_NOTRESET | @@ -2234,12 +2232,11 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg, int pos = 0; int resplen = sizeof(struct ng_mesg) + 512; MALLOC(*resp, struct ng_mesg *, resplen, - M_NETGRAPH, M_NOWAIT); + M_NETGRAPH, M_NOWAIT | M_ZERO); if (*resp == NULL) { error = ENOMEM; break; } - bzero(*resp, resplen); arg = (*resp)->data; /* diff --git a/sys/i386/isa/if_sr.c b/sys/i386/isa/if_sr.c index 89b2c99..b27d2f5 100644 --- a/sys/i386/isa/if_sr.c +++ b/sys/i386/isa/if_sr.c @@ -659,10 +659,10 @@ srattach_isa(struct isa_device *id) * Allocate the software interface table(s) */ MALLOC(hc->sc, struct sr_softc *, - hc->numports * sizeof(struct sr_softc), M_DEVBUF, M_WAITOK); + hc->numports * sizeof(struct sr_softc), + M_DEVBUF, M_WAITOK | M_ZERO); if (hc->sc == NULL) return(0); - bzero(hc->sc, hc->numports * sizeof(struct sr_softc)); id->id_ointr = srintr; @@ -768,18 +768,16 @@ srattach_pci(int unit, vm_offset_t plx_vaddr, vm_offset_t sca_vaddr) hc = hc->next; } - MALLOC(hc, struct sr_hardc *, sizeof(*hc), M_DEVBUF, M_WAITOK); + MALLOC(hc, struct sr_hardc *, sizeof(*hc), M_DEVBUF, M_WAITOK | M_ZERO); if (hc == NULL) return NULL; - bzero(hc, sizeof(*hc)); - MALLOC(hc->sc, struct sr_softc *, - numports * sizeof(struct sr_softc), M_DEVBUF, M_WAITOK); + MALLOC(hc->sc, struct sr_softc *, numports * sizeof(struct sr_softc), + M_DEVBUF, M_WAITOK | M_ZERO); if (hc->sc == NULL) { FREE(hc, M_DEVBUF); return NULL; } - bzero(hc->sc, numports * sizeof(struct sr_softc)); *hcp = hc; hc->numports = numports; @@ -3188,12 +3186,11 @@ ngsr_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, int pos = 0; int resplen = sizeof(struct ng_mesg) + 512; MALLOC(*resp, struct ng_mesg *, resplen, - M_NETGRAPH, M_NOWAIT); + M_NETGRAPH, M_NOWAIT | M_ZERO); if (*resp == NULL) { error = ENOMEM; break; } - bzero(*resp, resplen); arg = (*resp)->data; /* diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c index ffdcfc4..6f76185 100644 --- a/sys/i386/isa/intr_machdep.c +++ b/sys/i386/isa/intr_machdep.c @@ -546,10 +546,10 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, if (ithd == NULL || ithd->it_ih == NULL) { /* first handler for this irq. */ 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 (NULL); - bzero(ithd, sizeof(struct ithd)); ithd->irq = irq; ithds[irq] = ithd; } @@ -620,10 +620,9 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, else strcat(p->p_comm, "+"); } - idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK); + idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK | M_ZERO); if (idesc == NULL) return (NULL); - bzero(idesc, sizeof (struct intrhand)); idesc->ih_handler = handler; idesc->ih_argument = arg; diff --git a/sys/i386/isa/isa_compat.c b/sys/i386/isa/isa_compat.c index ef7d358..93d6dfa 100644 --- a/sys/i386/isa/isa_compat.c +++ b/sys/i386/isa/isa_compat.c @@ -269,10 +269,9 @@ compat_isa_handler(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - driver = malloc(sizeof(driver_t), M_DEVBUF, M_NOWAIT); + driver = malloc(sizeof(driver_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (!driver) return ENOMEM; - bzero(driver, sizeof(driver_t)); driver->name = id->name; driver->methods = isa_compat_methods; driver->size = sizeof(struct isa_device); diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c index a9341ff..36932b9 100644 --- a/sys/i386/isa/istallion.c +++ b/sys/i386/isa/istallion.c @@ -666,13 +666,12 @@ static stlibrd_t *stli_brdalloc(void) { stlibrd_t *brdp; - brdp = (stlibrd_t *) malloc(sizeof(stlibrd_t), M_TTYS, M_NOWAIT); + brdp = (stlibrd_t *) malloc(sizeof(stlibrd_t), M_TTYS, M_NOWAIT|M_ZERO); if (brdp == (stlibrd_t *) NULL) { printf("STALLION: failed to allocate memory (size=%d)\n", sizeof(stlibrd_t)); return((stlibrd_t *) NULL); } - bzero(brdp, sizeof(stlibrd_t)); return(brdp); } @@ -2513,12 +2512,11 @@ static int stli_initports(stlibrd_t *brdp) for (i = 0, panelnr = 0, panelport = 0; (i < brdp->nrports); i++) { portp = (stliport_t *) malloc(sizeof(stliport_t), M_TTYS, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (portp == (stliport_t *) NULL) { printf("STALLION: failed to allocate port structure\n"); continue; } - bzero(portp, sizeof(stliport_t)); portp->portnr = i; portp->brdnr = brdp->brdnr; diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c index ffdcfc4..6f76185 100644 --- a/sys/i386/isa/nmi.c +++ b/sys/i386/isa/nmi.c @@ -546,10 +546,10 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, if (ithd == NULL || ithd->it_ih == NULL) { /* first handler for this irq. */ 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 (NULL); - bzero(ithd, sizeof(struct ithd)); ithd->irq = irq; ithds[irq] = ithd; } @@ -620,10 +620,9 @@ inthand_add(const char *name, int irq, driver_intr_t handler, void *arg, else strcat(p->p_comm, "+"); } - idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK); + idesc = malloc(sizeof (struct intrhand), M_DEVBUF, M_WAITOK | M_ZERO); if (idesc == NULL) return (NULL); - bzero(idesc, sizeof (struct intrhand)); idesc->ih_handler = handler; idesc->ih_argument = arg; diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c index 7f5dd3a..21c30cc 100644 --- a/sys/i386/isa/rp.c +++ b/sys/i386/isa/rp.c @@ -1109,7 +1109,7 @@ rp_pciattach(pcici_t tag, int unit) rp_num_ports[unit] = num_ports; rp = (struct rp_port *) - malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT); + malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT|M_ZERO); if(rp == 0) { printf("rp_attach: Could not malloc rp_ports structures\n"); return; @@ -1119,14 +1119,12 @@ rp_pciattach(pcici_t tag, int unit) for(i=count;i < (count + rp_num_ports[unit]);i++) minor_to_unit[i] = unit; - bzero(rp, sizeof(struct rp_port) * num_ports); tty = (struct tty *) - malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT); + malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT|M_ZERO); if(tty == 0) { printf("rp_attach: Could not malloc tty structures\n"); return; } - bzero(tty, sizeof(struct tty) * num_ports); oldspl = spltty(); rp_addr(unit) = rp; @@ -1212,7 +1210,7 @@ struct isa_device *dev; rp_num_ports[unit] = num_ports; rp = (struct rp_port *) - malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT); + malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT|M_ZERO); if(rp == 0) { printf("rp_attach: Could not malloc rp_ports structures\n"); return(0); @@ -1222,14 +1220,12 @@ struct isa_device *dev; for(i=count;i < (count + rp_num_ports[unit]);i++) minor_to_unit[i] = unit; - bzero(rp, sizeof(struct rp_port) * num_ports); tty = (struct tty *) - malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT); + malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT|M_ZERO); if(tty == 0) { printf("rp_attach: Could not malloc tty structures\n"); return(0); } - bzero(tty, sizeof(struct tty) * num_ports); oldspl = spltty(); rp_addr(unit) = rp; diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c index 8162a45..07528a0 100644 --- a/sys/i386/isa/stallion.c +++ b/sys/i386/isa/stallion.c @@ -635,13 +635,12 @@ static int stlattach(struct isa_device *idp) idp->id_ointr = stlintr; - brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT); + brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT | M_ZERO); if (brdp == (stlbrd_t *) NULL) { printf("STALLION: failed to allocate memory (size=%d)\n", sizeof(stlbrd_t)); return(0); } - bzero(brdp, sizeof(stlbrd_t)); if ((brdp->brdnr = stl_findfreeunit()) < 0) { printf("STALLION: too many boards found, max=%d\n", @@ -707,13 +706,12 @@ void stlpciattach(pcici_t tag, int unit) printf("stlpciattach(tag=%x,unit=%x)\n", (int) &tag, unit); #endif - brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT); + brdp = (stlbrd_t *) malloc(sizeof(stlbrd_t), M_TTYS, M_NOWAIT | M_ZERO); if (brdp == (stlbrd_t *) NULL) { printf("STALLION: failed to allocate memory (size=%d)\n", sizeof(stlbrd_t)); return; } - bzero(brdp, sizeof(stlbrd_t)); if ((unit < 0) || (unit > STL_MAXBRDS)) { printf("STALLION: bad PCI board unit number=%d\n", unit); @@ -2596,13 +2594,12 @@ static int stl_initports(stlbrd_t *brdp, stlpanel_t *panelp) if ((chipmask & (0x1 << (i / 4))) == 0) continue; portp = (stlport_t *) malloc(sizeof(stlport_t), M_TTYS, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (portp == (stlport_t *) NULL) { printf("STALLION: failed to allocate port memory " "(size=%d)\n", sizeof(stlport_t)); break; } - bzero(portp, sizeof(stlport_t)); portp->portnr = i; portp->brdnr = panelp->brdnr; @@ -2701,13 +2698,13 @@ static int stl_initeio(stlbrd_t *brdp) outb(brdp->ioctrl, (stl_vecmap[brdp->irq] | ((brdp->irqtype) ? EIO_INTLEVEL : EIO_INTEDGE))); - panelp = (stlpanel_t *) malloc(sizeof(stlpanel_t), M_TTYS, M_NOWAIT); + panelp = (stlpanel_t *) malloc(sizeof(stlpanel_t), M_TTYS, + M_NOWAIT | M_ZERO); if (panelp == (stlpanel_t *) NULL) { printf("STALLION: failed to allocate memory (size=%d)\n", sizeof(stlpanel_t)); return(ENOMEM); } - bzero(panelp, sizeof(stlpanel_t)); panelp->brdnr = brdp->brdnr; panelp->panelnr = 0; @@ -2803,13 +2800,12 @@ static int stl_initech(stlbrd_t *brdp) if ((status & ECH_PNLIDMASK) != nxtid) break; panelp = (stlpanel_t *) malloc(sizeof(stlpanel_t), M_TTYS, - M_NOWAIT); + M_NOWAIT | M_ZERO); if (panelp == (stlpanel_t *) NULL) { printf("STALLION: failed to allocate memory" "(size=%d)\n", sizeof(stlpanel_t)); break; } - bzero(panelp, sizeof(stlpanel_t)); panelp->brdnr = brdp->brdnr; panelp->panelnr = panelnr; panelp->iobase = ioaddr; |