Showing error 1717

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/tcp_ipv4.c
Line in file: 1944
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 19:10:05 UTC


Source:

1914                read_lock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
1915                if (reqsk_queue_len(&icsk->icsk_accept_queue))
1916                        goto start_req;
1917                read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
1918                sk = sk_next(sk);
1919        }
1920get_sk:
1921        sk_for_each_from(sk, node) {
1922                if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) {
1923                        cur = sk;
1924                        goto out;
1925                }
1926                icsk = inet_csk(sk);
1927                read_lock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
1928                if (reqsk_queue_len(&icsk->icsk_accept_queue)) {
1929start_req:
1930                        st->uid                = sock_i_uid(sk);
1931                        st->syn_wait_sk = sk;
1932                        st->state        = TCP_SEQ_STATE_OPENREQ;
1933                        st->sbucket        = 0;
1934                        goto get_req;
1935                }
1936                read_unlock_bh(&icsk->icsk_accept_queue.syn_wait_lock);
1937        }
1938        if (++st->bucket < INET_LHTABLE_SIZE) {
1939                sk = sk_head(&tcp_hashinfo.listening_hash[st->bucket]);
1940                goto get_sk;
1941        }
1942        cur = NULL;
1943out:
1944        return cur;
1945}
1946
1947static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
1948{
1949        void *rc = listening_get_next(seq, NULL);
1950
1951        while (rc && *pos) {
1952                rc = listening_get_next(seq, rc);
1953                --*pos;
1954        }
Show full sources