summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-03-21 17:37:09 +0000
committerkettenis <kettenis@openbsd.org>2020-03-21 17:37:09 +0000
commitd53ed3a656162c0170002466d2d694690a54df82 (patch)
tree0a6befb34ccae375c23b2f788920dcc3b187242d
parentTeach i386 boot98) and friends about ffs2. fdboot(8) is the exception: (diff)
downloadwireguard-openbsd-d53ed3a656162c0170002466d2d694690a54df82.tar.xz
wireguard-openbsd-d53ed3a656162c0170002466d2d694690a54df82.zip
Fix crash when no device ports have been registered. Remove unused variable
while I'm there. ok patrick@
-rw-r--r--sys/dev/ofw/ofw_misc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/ofw/ofw_misc.c b/sys/dev/ofw/ofw_misc.c
index 53f3aa89685..56610fa816a 100644
--- a/sys/dev/ofw/ofw_misc.c
+++ b/sys/dev/ofw/ofw_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofw_misc.c,v 1.15 2020/03/16 21:51:26 kettenis Exp $ */
+/* $OpenBSD: ofw_misc.c,v 1.16 2020/03/21 17:37:09 kettenis Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis
*
@@ -568,8 +568,7 @@ endpoint_get_cookie(struct endpoint *ep)
void
device_port_activate(uint32_t phandle, void *arg)
{
- struct device_ports *ports;
- struct device_port *dp;
+ struct device_port *dp = NULL;
struct endpoint *ep, *rep;
int error;
@@ -582,7 +581,6 @@ device_port_activate(uint32_t phandle, void *arg)
if (dp == NULL)
return;
- ports = dp->dp_ports;
LIST_FOREACH(ep, &dp->dp_endpoints, ep_plist) {
rep = endpoint_remote(ep);
if (rep == NULL)