summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2007-09-07 15:00:19 +0000
committerart <art@openbsd.org>2007-09-07 15:00:19 +0000
commit28a8f404b7684433ec8c33a1be137fb4052d1648 (patch)
tree22f78d06ee32ceaa581cf540b3eaddba7db0b837 /sys/kern/subr_disk.c
parentSynced atomicio implementation in nc and sendbug with ssh. (diff)
downloadwireguard-openbsd-28a8f404b7684433ec8c33a1be137fb4052d1648.tar.xz
wireguard-openbsd-28a8f404b7684433ec8c33a1be137fb4052d1648.zip
Use M_ZERO in a few more places to shave bytes from the kernel.
eyeballed and ok dlg@
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 1764f23e0f8..d48b421f546 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.64 2007/08/05 04:26:21 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.65 2007/09/07 15:00:20 art Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -725,12 +725,11 @@ disk_attach(struct disk *diskp)
* it's not safe to sleep here, since we're probably going to be
* called during autoconfiguration.
*/
- diskp->dk_label = malloc(sizeof(struct disklabel), M_DEVBUF, M_NOWAIT);
+ diskp->dk_label = malloc(sizeof(struct disklabel), M_DEVBUF,
+ M_NOWAIT|M_ZERO);
if (diskp->dk_label == NULL)
panic("disk_attach: can't allocate storage for disklabel");
- bzero(diskp->dk_label, sizeof(struct disklabel));
-
/*
* Set the attached timestamp.
*/
@@ -911,11 +910,10 @@ bufq_default_alloc(void)
{
struct bufq_default *bq;
- bq = malloc(sizeof(*bq), M_DEVBUF, M_NOWAIT);
+ bq = malloc(sizeof(*bq), M_DEVBUF, M_NOWAIT|M_ZERO);
if (bq == NULL)
panic("bufq_default_alloc: no memory");
- memset(bq, 0, sizeof(*bq));
bq->bufq.bufq_free = bufq_default_free;
bq->bufq.bufq_add = bufq_default_add;
bq->bufq.bufq_get = bufq_default_get;