summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2005-11-27 09:29:43 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2005-11-27 09:29:43 +0000
commit79e3b716b5c55d1f62da8d5a98274bc14fbcc445 (patch)
tree37ded1ccc91ba3c1ed9f76bce09dc8e0b03db34a /sys
parent18a1691e9e1699c22823ccb665712ee9a7c6f83f (diff)
Fix dereference of uninitialised pointer in trunk_input() error path.
ok reyk@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_trunk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c
index 554c0fa6357..67a4efc2f10 100644
--- a/sys/net/if_trunk.c
+++ b/sys/net/if_trunk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_trunk.c,v 1.11 2005/11/27 09:27:14 mcbride Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.12 2005/11/27 09:29:42 mcbride Exp $ */
/*
* Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net>
@@ -906,7 +906,7 @@ trunk_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
{
struct trunk_softc *tr;
struct trunk_port *tp;
- struct ifnet *trifp;
+ struct ifnet *trifp = NULL;
int error = 0;
/* Should be checked by the caller */
@@ -937,7 +937,8 @@ trunk_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
return (0);
bad:
- trifp->if_ierrors++;
+ if (trifp)
+ trifp->if_ierrors++;
return (error);
}