diff options
author | 2015-12-23 17:07:09 +0000 | |
---|---|---|
committer | 2015-12-23 17:07:09 +0000 | |
commit | d05ffcd6d73ceed506d91a2b1c0f0763286d0cbf (patch) | |
tree | 5b34452706ca117506e82a337ee266eecded8114 | |
parent | Ooops. Wrong version of the diff committed, with reversed check for (diff) | |
download | wireguard-openbsd-d05ffcd6d73ceed506d91a2b1c0f0763286d0cbf.tar.xz wireguard-openbsd-d05ffcd6d73ceed506d91a2b1c0f0763286d0cbf.zip |
add aml_freevalue in a couple places, avoid storing a result that
would need to be freed in a couple other places
with deraadt
-rw-r--r-- | sys/dev/acpi/acpicpu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index 472d02ec1fc..e018ff91b08 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.70 2015/09/12 07:52:27 guenther Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.71 2015/12/23 17:07:09 jcs Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> @@ -260,6 +260,7 @@ acpicpu_set_pdc(struct acpicpu_softc *sc) if (res.type != AML_OBJTYPE_BUFFER || res.length < 8) { printf(": unable to query capabilities\n"); + aml_freevalue(&res); return; } @@ -283,8 +284,10 @@ acpicpu_set_pdc(struct acpicpu_softc *sc) osc_cmd[3].v_buffer = (int8_t *)&buf; osc_cmd[3].length = sizeof(buf); + aml_freevalue(&res); + aml_evalname(sc->sc_acpi, sc->sc_devnode, "_OSC", - 4, osc_cmd, &res); + 4, osc_cmd, NULL); } else { /* Evaluate _PDC */ memset(&cmd, 0, sizeof(cmd)); @@ -297,7 +300,7 @@ acpicpu_set_pdc(struct acpicpu_softc *sc) buf[2] = cap; aml_evalname(sc->sc_acpi, sc->sc_devnode, "_PDC", - 1, &cmd, &res); + 1, &cmd, NULL); } } |