diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 01:02:24 -0400 | 
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 01:02:24 -0400 | 
| commit | 343b0597297c3190647854881c087c01faf40a6f (patch) | |
| tree | 81cf818936bfd4aff891d1ca4d4ea4d47b2d1631 /net/ipv4/tcp_ipv4.c | |
| parent | b2dabd5aadae6a93026f35269e1e53c1a0c6de2d (diff) | |
| parent | b2382b363df828f25e35ed8b70a3da33b29b2a64 (diff) | |
/spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 5d91213d34c..67c670886c1 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -242,9 +242,14 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum)  		tcp_port_rover = rover;  		spin_unlock(&tcp_portalloc_lock); -		/* Exhausted local port range during search? */ +		/* Exhausted local port range during search?  It is not +		 * possible for us to be holding one of the bind hash +		 * locks if this test triggers, because if 'remaining' +		 * drops to zero, we broke out of the do/while loop at +		 * the top level, not from the 'break;' statement. +		 */  		ret = 1; -		if (remaining <= 0) +		if (unlikely(remaining <= 0))  			goto fail;  		/* OK, here is the one we will use.  HEAD is | 
