summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-01 09:20:38 +0000
committerphk <phk@FreeBSD.org>2003-06-01 09:20:38 +0000
commitccba2648b0f0471eb431a273db8797855b70a66b (patch)
treefbdaa5d2b1d3277d525b76c85114cdd68a2883c9 /sys
parent305dd90d00e61906978e37397342e29a986fff14 (diff)
downloadFreeBSD-src-ccba2648b0f0471eb431a273db8797855b70a66b.zip
FreeBSD-src-ccba2648b0f0471eb431a273db8797855b70a66b.tar.gz
Remove unused variables.
Found by: FlexeLint
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_encap.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sys/netinet/ip_encap.c b/sys/netinet/ip_encap.c
index a547c66..edaadc4 100644
--- a/sys/netinet/ip_encap.c
+++ b/sys/netinet/ip_encap.c
@@ -279,6 +279,7 @@ encap6_input(mp, offp, proto)
}
#endif
+/*lint -sem(encap_add, custodial(1)) */
static void
encap_add(ep)
struct encaptab *ep;
@@ -302,21 +303,17 @@ encap_attach(af, proto, sp, sm, dp, dm, psw, arg)
void *arg;
{
struct encaptab *ep;
- int error;
int s;
s = splnet();
/* sanity check on args */
if (sp->sa_len > sizeof(ep->src) || dp->sa_len > sizeof(ep->dst)) {
- error = EINVAL;
goto fail;
}
if (sp->sa_len != dp->sa_len) {
- error = EINVAL;
goto fail;
}
if (af != sp->sa_family || af != dp->sa_family) {
- error = EINVAL;
goto fail;
}
@@ -335,13 +332,11 @@ encap_attach(af, proto, sp, sm, dp, dm, psw, arg)
bcmp(&ep->dstmask, dm, dp->sa_len) != 0)
continue;
- error = EEXIST;
goto fail;
}
ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/
if (ep == NULL) {
- error = ENOBUFS;
goto fail;
}
bzero(ep, sizeof(*ep));
@@ -357,7 +352,6 @@ encap_attach(af, proto, sp, sm, dp, dm, psw, arg)
encap_add(ep);
- error = 0;
splx(s);
return ep;
@@ -375,21 +369,16 @@ encap_attach_func(af, proto, func, psw, arg)
void *arg;
{
struct encaptab *ep;
- int error;
int s;
s = splnet();
/* sanity check on args */
- if (!func) {
- error = EINVAL;
+ if (!func)
goto fail;
- }
ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /*XXX*/
- if (ep == NULL) {
- error = ENOBUFS;
+ if (ep == NULL)
goto fail;
- }
bzero(ep, sizeof(*ep));
ep->af = af;
@@ -400,7 +389,6 @@ encap_attach_func(af, proto, func, psw, arg)
encap_add(ep);
- error = 0;
splx(s);
return ep;
OpenPOWER on IntegriCloud