User: | Jiri Slaby |
Error type: | Leaving function in locked state |
Error type description: | Some lock is not unlocked on all paths of a function, so it is leaked |
File location: | net/ipv4/inet_connection_sock.c |
Line in file: | 179 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
Undetermined 1 |
Entered: | 2012-03-02 21:35:17 UTC |
149 goto success; 150 } else { 151 ret = 1; 152 if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) 153 goto fail_unlock; 154 } 155 } 156tb_not_found: 157 ret = 1; 158 if (!tb && (tb = inet_bind_bucket_create(hashinfo->bind_bucket_cachep, 159 net, head, snum)) == NULL) 160 goto fail_unlock; 161 if (hlist_empty(&tb->owners)) { 162 if (sk->sk_reuse && sk->sk_state != TCP_LISTEN) 163 tb->fastreuse = 1; 164 else 165 tb->fastreuse = 0; 166 } else if (tb->fastreuse && 167 (!sk->sk_reuse || sk->sk_state == TCP_LISTEN)) 168 tb->fastreuse = 0; 169success: 170 if (!inet_csk(sk)->icsk_bind_hash) 171 inet_bind_hash(sk, tb, snum); 172 WARN_ON(inet_csk(sk)->icsk_bind_hash != tb); 173 ret = 0; 174 175fail_unlock: 176 spin_unlock(&head->lock); 177fail: 178 local_bh_enable(); 179 return ret; 180} 181 182EXPORT_SYMBOL_GPL(inet_csk_get_port); 183 184/* 185 * Wait for an incoming connection, avoid race conditions. This must be called 186 * with the socket locked. 187 */ 188static int inet_csk_wait_for_connect(struct sock *sk, long timeo) 189{