summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-12-16 02:05:11 +0000
committerkmacy <kmacy@FreeBSD.org>2008-12-16 02:05:11 +0000
commit9682e6d3372a3a7c58f6a9f936d968ba0378d792 (patch)
treeda415634b8e06ed2b0c64e2e31a060569b200e13 /sys/netinet6
parent0b5a9dada12dde838a64bac4da7e0449ce0ab566 (diff)
downloadFreeBSD-src-9682e6d3372a3a7c58f6a9f936d968ba0378d792.zip
FreeBSD-src-9682e6d3372a3a7c58f6a9f936d968ba0378d792.tar.gz
need to check that lle is not null before unlock if the break condition is not met
also fix the break condition to explicitly check against NULL
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/nd6_rtr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 6c4f145..bc1ccc6 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1333,13 +1333,14 @@ find_pfxlist_reachable_router(struct nd_prefix *pr)
for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr;
pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) {
IF_AFDATA_LOCK(pfxrtr->router->ifp);
- if ((ln = nd6_lookup(&pfxrtr->router->rtaddr, 0,
- pfxrtr->router->ifp)) &&
+ if (((ln = nd6_lookup(&pfxrtr->router->rtaddr, 0,
+ pfxrtr->router->ifp)) != NULL) &&
ND6_IS_LLINFO_PROBREACH(ln)) {
LLE_RUNLOCK(ln);
break; /* found */
}
- LLE_RUNLOCK(ln);
+ if (ln != NULL)
+ LLE_RUNLOCK(ln);
IF_AFDATA_UNLOCK(pfxrtr->router->ifp);
}
return (pfxrtr);
OpenPOWER on IntegriCloud