summaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-23 22:12:23 -0400
committerLen Brown <len.brown@intel.com>2005-08-23 22:12:23 -0400
commit84ffa747520edd4556b136bdfc9df9eb1673ce12 (patch)
tree1cfe20bd31fce1b5b3024384fcb324c3338d1d32 /net/ipv6/tcp_ipv6.c
parent702c7e7626deeabb057b6f529167b65ec2eefbdb (diff)
parent81065e2f415af6c028eac13f481fb9e60a0b487b (diff)
downloadop-kernel-dev-84ffa747520edd4556b136bdfc9df9eb1673ce12.zip
op-kernel-dev-84ffa747520edd4556b136bdfc9df9eb1673ce12.tar.gz
Merge from-linus to-akpm
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f6e288d..ef29cfd 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -158,9 +158,14 @@ static int tcp_v6_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. */
OpenPOWER on IntegriCloud