diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-09 06:58:30 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-09 06:58:30 +0000 |
commit | ad90d9845d96f21749e3776b0296938c6d60ca9a (patch) | |
tree | ca999709d208d683272d9911f2706d59a203748f /sys/dev/acpi/acpimadt.c | |
parent | 7ac588b8eb1d276029001886214facee144b2fc5 (diff) |
Replace some malloc(n*size,...) calls with mallocarray().
ok tedu@ deraadt@
Diffstat (limited to 'sys/dev/acpi/acpimadt.c')
-rw-r--r-- | sys/dev/acpi/acpimadt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c index c285986c09c..1c8a9e49c3f 100644 --- a/sys/dev/acpi/acpimadt.c +++ b/sys/dev/acpi/acpimadt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpimadt.c,v 1.29 2014/07/12 18:48:17 tedu Exp $ */ +/* $OpenBSD: acpimadt.c,v 1.30 2014/12/09 06:58:29 doug Exp $ */ /* * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org> * @@ -294,7 +294,8 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) addr += entry->madt_lapic.length; } - mp_intrs = malloc(nlapic_nmis * sizeof (struct mp_intr_map), M_DEVBUF, M_NOWAIT); + mp_intrs = mallocarray(nlapic_nmis, sizeof(struct mp_intr_map), + M_DEVBUF, M_NOWAIT); if (mp_intrs == NULL) return; |