diff options
author | 2006-05-02 16:14:51 +0000 | |
---|---|---|
committer | 2006-05-02 16:14:51 +0000 | |
commit | 46acb4095c2916f898d817f742494545b3433d71 (patch) | |
tree | a58350210313bd6ee716f2067e6929d17afa1a07 | |
parent | The pftable name to ID functions should use the pftable_labels list and not (diff) | |
download | wireguard-openbsd-46acb4095c2916f898d817f742494545b3433d71.tar.xz wireguard-openbsd-46acb4095c2916f898d817f742494545b3433d71.zip |
* Plug memory leak if init fails; ok gwk@
-rw-r--r-- | sys/arch/i386/i386/powernow-k7.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c index 68fd605dfdf..f206fc5066c 100644 --- a/sys/arch/i386/i386/powernow-k7.c +++ b/sys/arch/i386/i386/powernow-k7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k7.c,v 1.19 2006/04/18 03:29:47 gwk Exp $ */ +/* $OpenBSD: powernow-k7.c,v 1.20 2006/05/02 16:14:51 pat Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -328,10 +328,6 @@ k7_powernow_init(void) ci = curcpu(); - cstate = malloc(sizeof(struct k7pnow_cpu_state), M_DEVBUF, M_NOWAIT); - if (!cstate) - return; - cpuid(0x80000000, regs); if (regs[0] < 0x80000007) return; @@ -340,6 +336,10 @@ k7_powernow_init(void) if (!(regs[3] & AMD_PN_FID_VID)) return; + cstate = malloc(sizeof(struct k7pnow_cpu_state), M_DEVBUF, M_NOWAIT); + if (!cstate) + return; + cstate->flags = 0; if (ci->ci_signature == AMD_ERRATA_A0_CPUSIG) cstate->flags |= PN7_FLAG_ERRATA_A0; |