summaryrefslogtreecommitdiffstats
path: root/sys/dev/sr
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commitdd75d1d73b4f3034c1d9f621a49fff58b1d71eb1 (patch)
tree197ae73617ae75afe008897f6906b84835589ea2 /sys/dev/sr
parented5dbfbd3cd619638a7baac288f548aa1398edac (diff)
downloadFreeBSD-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/dev/sr')
-rw-r--r--sys/dev/sr/if_sr.c15
-rw-r--r--sys/dev/sr/if_sr_isa.c15
2 files changed, 12 insertions, 18 deletions
diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c
index 89b2c99..b27d2f5 100644
--- a/sys/dev/sr/if_sr.c
+++ b/sys/dev/sr/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/dev/sr/if_sr_isa.c b/sys/dev/sr/if_sr_isa.c
index 89b2c99..b27d2f5 100644
--- a/sys/dev/sr/if_sr_isa.c
+++ b/sys/dev/sr/if_sr_isa.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;
/*
OpenPOWER on IntegriCloud