summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2006-03-09 05:16:28 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2006-03-09 05:16:28 +0000
commite9152289a4f7a9adce4d0ebb8a65eae0e5c388ef (patch)
tree9ffb459463e552bad9e581b1a566e09e945a3a37 /sys/dev
parent019a147d92e71f98767545f90effda513d10f364 (diff)
Fixed free before malloc. bad marco
ok marco@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpicpu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 166da23ae0a..a4b027d710b 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.8 2006/03/05 04:48:55 marco Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.9 2006/03/09 05:16:27 jordan Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -222,12 +222,12 @@ acpicpu_getpss(struct acpicpu_softc *sc)
return (1);
}
- if (!sc->sc_pss)
- sc->sc_pss = malloc(res.length * sizeof *sc->sc_pss, M_DEVBUF,
- M_WAITOK);
- else
+ if (sc->sc_pss)
free(sc->sc_pss, M_DEVBUF);
+ sc->sc_pss = malloc(res.length * sizeof *sc->sc_pss, M_DEVBUF,
+ M_WAITOK);
+
memset(sc->sc_pss, 0, res.length * sizeof *sc->sc_pss);
for (i = 0; i < res.length; i++) {