From b138ddd4e5e63f5cc8f2e761dd0a2c312058bda4 Mon Sep 17 00:00:00 2001 From: jmg Date: Mon, 26 Jul 2004 21:29:56 +0000 Subject: 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) --- sys/netinet/tcp_usrreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/netinet/tcp_usrreq.c') 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); -- cgit v1.1