summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-16 16:17:17 +0000
committersam <sam@FreeBSD.org>2003-10-16 16:17:17 +0000
commitbf970aa6cf65ceb1d1ffb43a34f630c4bedebc67 (patch)
treee38ee4ccbad7f1a86d1e81812e5a6a19cfa9ee18
parent2044616f8e46ab43a26fa3e1fe1ed2d138530d2c (diff)
downloadFreeBSD-src-bf970aa6cf65ceb1d1ffb43a34f630c4bedebc67.zip
FreeBSD-src-bf970aa6cf65ceb1d1ffb43a34f630c4bedebc67.tar.gz
Correct handling of cloning loop avoidance: rtalloc1 may return a null
pointer in which case we should not do the unlock. Supported by: FreeBSD Foundatin
-rw-r--r--sys/net/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 55eb2d0..46e811d 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1000,7 +1000,8 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate)
rt->rt_gwroute = 0;
return EDQUOT; /* failure */
}
- RT_UNLOCK(rt->rt_gwroute);
+ if (rt->rt_gwroute != NULL)
+ RT_UNLOCK(rt->rt_gwroute);
}
/*
OpenPOWER on IntegriCloud