summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-09-20 03:28:49 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-09-20 03:28:49 +0000
commit42e642d4aa8891f7e40cf39c69c8634bc45688b4 (patch)
tree05229ac17729eeeb7d2eaedefb9b52f967775f75 /sys
parentf19e4847c461b9d198dc6bcd73c07bb762a026e2 (diff)
Fix unitialised variable access in the suspend/resume case
that crept in with rev 1.77, spotted by the clang static analyser. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uhci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 50eacad3f27..6cb88b750c1 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.81 2010/09/07 16:21:46 deraadt Exp $ */
+/* $OpenBSD: uhci.c,v 1.82 2010/09/20 03:28:48 jsg Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -542,6 +542,7 @@ uhci_activate(struct device *self, int act)
UWRITE2(sc, UHCI_INTR, 0); /* disable intrs */
+ cmd = UREAD2(sc, UHCI_CMD);
UHCICMD(sc, cmd | UHCI_CMD_EGSM); /* enter global suspend */
usb_delay_ms(&sc->sc_bus, USB_RESUME_WAIT);
sc->sc_suspend = act;
@@ -555,6 +556,7 @@ uhci_activate(struct device *self, int act)
#endif
sc->sc_bus.use_polling++;
sc->sc_suspend = act;
+ cmd = UREAD2(sc, UHCI_CMD);
if (cmd & UHCI_CMD_RS)
uhci_run(sc, 0); /* in case BIOS has started it */