diff options
| author | 2009-09-02 04:45:20 +0000 | |
|---|---|---|
| committer | 2009-09-02 04:45:20 +0000 | |
| commit | 3b39b81f1db44ecd38dfbec686df97ccc399acdc (patch) | |
| tree | 6493fecb7d86e0185f45410e92558f17e535120b /sys/dev/acpi/acpipwrres.c | |
| parent | pxa2x0_mmc.c: optimize the speed of the interrupt handler (diff) | |
| download | wireguard-openbsd-3b39b81f1db44ecd38dfbec686df97ccc399acdc.tar.xz wireguard-openbsd-3b39b81f1db44ecd38dfbec686df97ccc399acdc.zip | |
Invoke malloc() with the correct sizeof value in acpipwrres_foundcons().
This was harmless but eating too much memory.
ok pirofti@
Diffstat (limited to 'sys/dev/acpi/acpipwrres.c')
| -rw-r--r-- | sys/dev/acpi/acpipwrres.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpipwrres.c b/sys/dev/acpi/acpipwrres.c index 5f71cb9f20d..eeb02c84090 100644 --- a/sys/dev/acpi/acpipwrres.c +++ b/sys/dev/acpi/acpipwrres.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipwrres.c,v 1.1 2009/06/03 07:13:48 pirofti Exp $ */ +/* $OpenBSD: acpipwrres.c,v 1.2 2009/09/02 04:45:20 miod Exp $ */ /* * Copyright (c) 2009 Paul Irofti <pirofti@openbsd.org> * @@ -198,7 +198,7 @@ acpipwrres_foundcons(struct aml_node *node, void *arg) res.v_package[i]->v_string); if (pnode == sc->sc_devnode) { DPRINTF(("%s: consumer match\n", DEVNAME(sc))); - cons = malloc(sizeof *pnode, M_DEVBUF, + cons = malloc(sizeof *cons, M_DEVBUF, M_WAITOK | M_ZERO); cons->cs_node = pnode; TAILQ_INSERT_HEAD(&sc->sc_cons, cons, cs_link); |
