summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2004-07-26 21:29:56 +0000
committerjmg <jmg@FreeBSD.org>2004-07-26 21:29:56 +0000
commitb138ddd4e5e63f5cc8f2e761dd0a2c312058bda4 (patch)
tree73fb08353b5039cd99fa662fac78b0642fe1fa3b /sys/netinet/tcp_usrreq.c
parent00d7c9fc337c3c0921f961ebf8ce29c7d23f0fbb (diff)
downloadFreeBSD-src-b138ddd4e5e63f5cc8f2e761dd0a2c312058bda4.zip
FreeBSD-src-b138ddd4e5e63f5cc8f2e761dd0a2c312058bda4.tar.gz
compare pointer against NULL, not 0
when inpcb is NULL, this is no longer invalid since jlemon added the tcp_twstart function... this prevents close "failing" w/ EINVAL when it really was successful... Reviewed by: jeremy (NetBSD)
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 1942f6b..1e96129 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -162,9 +162,9 @@ tcp_usr_detach(struct socket *so)
INP_INFO_WLOCK(&tcbinfo);
inp = sotoinpcb(so);
- if (inp == 0) {
+ if (inp == NULL) {
INP_INFO_WUNLOCK(&tcbinfo);
- return EINVAL; /* XXX */
+ return error;
}
INP_LOCK(inp);
tp = intotcpcb(inp);
OpenPOWER on IntegriCloud