summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-03-16 02:39:58 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-03-16 02:39:58 +0000
commit6f1a0846b2ef1834287b408614441d4816497d49 (patch)
treed617280dce0860d4b93a90c2261ce8d07bb5ec95 /sys
parentfe91240cccde044df3c10e9f1b785c09dcf49898 (diff)
dont leak memory when we fail to find any valid states.
from gwk, ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/powernow-k8.c4
-rw-r--r--sys/arch/i386/i386/powernow-k8.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/powernow-k8.c b/sys/arch/amd64/amd64/powernow-k8.c
index e233f6630d5..207aa6d0138 100644
--- a/sys/arch/amd64/amd64/powernow-k8.c
+++ b/sys/arch/amd64/amd64/powernow-k8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k8.c,v 1.3 2006/03/16 02:35:08 dlg Exp $ */
+/* $OpenBSD: powernow-k8.c,v 1.4 2006/03/16 02:39:57 dlg Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
* All rights reserved.
@@ -401,6 +401,8 @@ k8_powernow_init(void)
printf(" Mhz\n");
k8pnow_current_state = cstate;
cpu_setperf = k8_powernow_setperf;
+ return;
}
}
+ free(cstate, M_DEVBUF);
}
diff --git a/sys/arch/i386/i386/powernow-k8.c b/sys/arch/i386/i386/powernow-k8.c
index 5a8e0367bfa..dd8231eebad 100644
--- a/sys/arch/i386/i386/powernow-k8.c
+++ b/sys/arch/i386/i386/powernow-k8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k8.c,v 1.6 2006/03/16 02:35:08 dlg Exp $ */
+/* $OpenBSD: powernow-k8.c,v 1.7 2006/03/16 02:39:57 dlg Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
@@ -403,6 +403,8 @@ k8_powernow_init(void)
printf(" Mhz\n");
k8pnow_current_state = cstate;
cpu_setperf = k8_powernow_setperf;
+ return;
}
}
+ free(cstate, M_DEVBUF);
}