summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/vga_pci.c
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>2002-07-13 20:33:47 +0000
committermickey <mickey@openbsd.org>2002-07-13 20:33:47 +0000
commit7997e226418e422af68cc6ed45903cd5b6c34a64 (patch)
tree9c1074904a7957211e7d6460f40332715e05948b /sys/dev/pci/vga_pci.c
parentKNF (diff)
downloadwireguard-openbsd-7997e226418e422af68cc6ed45903cd5b6c34a64.tar.xz
wireguard-openbsd-7997e226418e422af68cc6ed45903cd5b6c34a64.zip
fix ioctl processing logic; problem reported by postman pechkin
Diffstat (limited to 'sys/dev/pci/vga_pci.c')
-rw-r--r--sys/dev/pci/vga_pci.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index e087c24748c..88bdb845398 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga_pci.c,v 1.12 2002/07/12 20:17:03 mickey Exp $ */
+/* $OpenBSD: vga_pci.c,v 1.13 2002/07/13 20:33:47 mickey Exp $ */
/* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */
/*-
@@ -307,6 +307,8 @@ vga_pci_ioctl(v, cmd, addr, flag, p)
switch (cmd) {
case AGPIOC_INFO:
+ if (!sc->sc_chipc)
+ return (ENXIO);
case AGPIOC_ACQUIRE:
case AGPIOC_RELEASE:
case AGPIOC_SETUP:
@@ -314,12 +316,10 @@ vga_pci_ioctl(v, cmd, addr, flag, p)
case AGPIOC_DEALLOCATE:
case AGPIOC_BIND:
case AGPIOC_UNBIND:
- if (!sc->sc_chipc)
- return (ENXIO);
+ if (cmd != AGPIOC_INFO && !(flag & FWRITE))
+ return (EPERM);
+ break;
}
-
- if (cmd != AGPIOC_INFO && !(flag & FWRITE))
- return (EPERM);
#endif
switch (cmd) {