aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2012-02-15 14:29:23 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2012-02-15 14:29:23 +0000
commitc3189b3fb4773008772b10d20e3f20da60cc4de5 (patch)
treefce06c2b382dafbb7e6669a4868fb08cb11a1638
parent19afcd982934ca8fd502de68e3f21ce50669b6cc (diff)
Notes
-rw-r--r--sys/netgraph/ng_base.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 2721debd1452..deed226006f4 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -1161,6 +1161,10 @@ ng_bypass(hook_p hook1, hook_p hook2)
return (EINVAL);
}
mtx_lock(&ng_topo_mtx);
+ if (NG_HOOK_NOT_VALID(hook1) || NG_HOOK_NOT_VALID(hook2)) {
+ mtx_unlock(&ng_topo_mtx);
+ return (EINVAL);
+ }
hook1->hk_peer->hk_peer = hook2->hk_peer;
hook2->hk_peer->hk_peer = hook1->hk_peer;