diff options
| author | jruoho <jruoho@NetBSD.org> | 2011-10-06 14:05:26 +0000 |
|---|---|---|
| committer | jruoho <jruoho@NetBSD.org> | 2011-10-06 14:05:26 +0000 |
| commit | 46fd3aa286eb7ddb41cd405b548e819554c498f8 (patch) | |
| tree | c92b372314f1051aa464d2eee71ce1fa09b0e9a9 | |
| parent | 7a918a538d2d4eb109d810f0d9377d292a349814 (diff) | |
Like the comment says, also MSR_IA32_EXT_CONFIG is unsafe; use rdmsr_safe().
Fixes the panic reported by njoly@.
| -rw-r--r-- | sys/arch/x86/x86/coretemp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/x86/x86/coretemp.c b/sys/arch/x86/x86/coretemp.c index b3621a39bb8..dc261fd884d 100644 --- a/sys/arch/x86/x86/coretemp.c +++ b/sys/arch/x86/x86/coretemp.c @@ -1,4 +1,4 @@ -/* $NetBSD: coretemp.c,v 1.27 2011/09/24 10:52:56 jruoho Exp $ */ +/* $NetBSD: coretemp.c,v 1.28 2011/10/06 14:05:26 jruoho Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.27 2011/09/24 10:52:56 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.28 2011/10/06 14:05:26 jruoho Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -281,7 +281,8 @@ coretemp_tjmax(device_t self) if ((model == 0x0F && stepping >= 2) || (model == 0x0E && extmodel != 1)) { - msr = rdmsr(MSR_IA32_EXT_CONFIG); + if (rdmsr_safe(MSR_IA32_EXT_CONFIG, &msr) == EFAULT) + return; if ((msr & __BIT(30)) != 0) { sc->sc_tjmax = 85; |
