summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2000-10-29 15:47:16 +0000
committerdwmalone <dwmalone@FreeBSD.org>2000-10-29 15:47:16 +0000
commit7d9d396fd545532b28c0dea8ef9f385b4fff4578 (patch)
treeb0111113d7d91dcd25f09237023149e8ffd0f996 /sys/dev
parentf8eaa3d8016b5b89b5f98f3e579e75ed926fc118 (diff)
downloadFreeBSD-src-7d9d396fd545532b28c0dea8ef9f385b4fff4578.zip
FreeBSD-src-7d9d396fd545532b28c0dea8ef9f385b4fff4578.tar.gz
Add the use of M_ZERO to some malloc calls.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/advansys/adwcam.c3
-rw-r--r--sys/dev/ahb/ahb.c3
-rw-r--r--sys/dev/aic7xxx/aic7xxx_freebsd.c5
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c5
4 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c
index 77c1718..3c9b00b 100644
--- a/sys/dev/advansys/adwcam.c
+++ b/sys/dev/advansys/adwcam.c
@@ -824,12 +824,11 @@ adw_alloc(device_t dev, struct resource *regs, int regs_type, int regs_id)
/*
* Allocate a storage area for us
*/
- adw = malloc(sizeof(struct adw_softc), M_DEVBUF, M_NOWAIT);
+ adw = malloc(sizeof(struct adw_softc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (adw == NULL) {
printf("adw%d: cannot malloc!\n", device_get_unit(dev));
return NULL;
}
- bzero(adw, sizeof(struct adw_softc));
LIST_INIT(&adw->pending_ccbs);
SLIST_INIT(&adw->sg_maps);
adw->device = dev;
diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c
index 9fc15a4..bbd6fd0 100644
--- a/sys/dev/ahb/ahb.c
+++ b/sys/dev/ahb/ahb.c
@@ -393,12 +393,11 @@ ahballoc(u_long unit, struct resource *res)
/*
* Allocate a storage area for us
*/
- ahb = malloc(sizeof(struct ahb_softc), M_DEVBUF, M_NOWAIT);
+ ahb = malloc(sizeof(struct ahb_softc), M_DEVBUF, M_NOWAIT | M_ZERO);
if (!ahb) {
printf("ahb%ld: cannot malloc!\n", unit);
return (NULL);
}
- bzero(ahb, sizeof(struct ahb_softc));
SLIST_INIT(&ahb->free_ecbs);
LIST_INIT(&ahb->pending_ccbs);
ahb->unit = unit;
diff --git a/sys/dev/aic7xxx/aic7xxx_freebsd.c b/sys/dev/aic7xxx/aic7xxx_freebsd.c
index 4ca846c..31ae3a5 100644
--- a/sys/dev/aic7xxx/aic7xxx_freebsd.c
+++ b/sys/dev/aic7xxx/aic7xxx_freebsd.c
@@ -1795,11 +1795,10 @@ ahc_platform_set_tags(struct ahc_softc *ahc,
int
ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
{
- ahc->platform_data =
- malloc(sizeof(struct ahc_platform_data), M_DEVBUF, M_NOWAIT);
+ ahc->platform_data = malloc(sizeof(struct ahc_platform_data), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
if (ahc->platform_data == NULL)
return (ENOMEM);
- memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data));
return (0);
}
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c
index 4ca846c..31ae3a5 100644
--- a/sys/dev/aic7xxx/aic7xxx_osm.c
+++ b/sys/dev/aic7xxx/aic7xxx_osm.c
@@ -1795,11 +1795,10 @@ ahc_platform_set_tags(struct ahc_softc *ahc,
int
ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg)
{
- ahc->platform_data =
- malloc(sizeof(struct ahc_platform_data), M_DEVBUF, M_NOWAIT);
+ ahc->platform_data = malloc(sizeof(struct ahc_platform_data), M_DEVBUF,
+ M_NOWAIT | M_ZERO);
if (ahc->platform_data == NULL)
return (ENOMEM);
- memset(ahc->platform_data, 0, sizeof(struct ahc_platform_data));
return (0);
}
OpenPOWER on IntegriCloud