summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2013-06-25 13:42:28 +0000
committermpi <mpi@openbsd.org>2013-06-25 13:42:28 +0000
commit6a2ba379f6857935eb83aa90619d5310e5aca6cf (patch)
treea002b5c0ed56513cd3b0ff165456b622a83267d7
parentbring return value of pcap_breakloop in sync with reality. (diff)
downloadwireguard-openbsd-6a2ba379f6857935eb83aa90619d5310e5aca6cf.tar.xz
wireguard-openbsd-6a2ba379f6857935eb83aa90619d5310e5aca6cf.zip
Do not dereference sc before checking if it exists, pointed by otto@.
-rw-r--r--sys/dev/usb/ucom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 400d11f2016..1f5eed2300d 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ucom.c,v 1.59 2013/06/03 16:10:56 mpi Exp $ */
+/* $OpenBSD: ucom.c,v 1.60 2013/06/25 13:42:28 mpi Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/*
@@ -585,7 +585,7 @@ int
ucomread(dev_t dev, struct uio *uio, int flag)
{
struct ucom_softc *sc = ucom_cd.cd_devs[UCOMUNIT(dev)];
- struct tty *tp = sc->sc_tty;
+ struct tty *tp;
int error;
if (sc == NULL || sc->sc_dying)