summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthieu <matthieu@openbsd.org>2008-06-15 15:31:55 +0000
committermatthieu <matthieu@openbsd.org>2008-06-15 15:31:55 +0000
commit8d612ed28425c0283514c1f6c9954d5b3fbe552c (patch)
treee47dc1910920836142116f7557dcbfd583a8cf1f
parentsync (diff)
downloadwireguard-openbsd-8d612ed28425c0283514c1f6c9954d5b3fbe552c.tar.xz
wireguard-openbsd-8d612ed28425c0283514c1f6c9954d5b3fbe552c.zip
When APERTURE is not defined, always return ENXIO.
Suggested by mk@, ok miod@ deraadt@.
-rw-r--r--sys/arch/i386/i386/amdmsr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/amdmsr.c b/sys/arch/i386/i386/amdmsr.c
index 95b9d8791f5..38ea7534678 100644
--- a/sys/arch/i386/i386/amdmsr.c
+++ b/sys/arch/i386/i386/amdmsr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdmsr.c,v 1.2 2008/06/15 01:18:22 deraadt Exp $ */
+/* $OpenBSD: amdmsr.c,v 1.3 2008/06/15 15:31:55 matthieu Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
@@ -82,17 +82,17 @@ amdmsr_attach(struct device *parent, struct device *self, void *aux)
int
amdmsropen(dev_t dev, int flags, int devtype, struct proc *p)
{
- if (suser(p, 0) != 0)
- return EPERM;
#ifdef APERTURE
- if (!allowaperture)
+ if (suser(p, 0) != 0 || !allowaperture)
return EPERM;
-#endif
/* allow only one simultaneous open() */
if (amdmsr_open_cnt > 0)
return EPERM;
amdmsr_open_cnt++;
return 0;
+#else
+ return ENXIO;
+#endif
}
int