summaryrefslogtreecommitdiff
path: root/sys/kern/subr_autoconf.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-13 15:29:05 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-13 15:29:05 +0000
commitd236d22228b6a97ce7c79025114524f150fff4cc (patch)
treeb242eac83ec5c1b92073488875fa72c4cb5b0ccc /sys/kern/subr_autoconf.c
parentc38623b68ad6f6d9a521c779ac660b49e1590d64 (diff)
use mallocarray where arguments are multipled. ok deraadt
Diffstat (limited to 'sys/kern/subr_autoconf.c')
-rw-r--r--sys/kern/subr_autoconf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index f0994287b46..e716a254acb 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.77 2014/07/12 18:43:32 tedu Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.78 2014/07/13 15:29:04 tedu Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -462,7 +462,7 @@ config_make_softc(struct device *parent, struct cfdata *cf)
while (new <= dev->dv_unit)
new *= 2;
cd->cd_ndevs = new;
- nsp = malloc(new * sizeof(void *), M_DEVBUF, M_NOWAIT|M_ZERO);
+ nsp = mallocarray(new, sizeof(void *), M_DEVBUF, M_NOWAIT|M_ZERO);
if (nsp == NULL)
panic("config_make_softc: %sing dev array",
old != 0 ? "expand" : "creat");