Showing error 1482

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: 2003
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

1973                struct inet_timewait_sock *tw;
1974                rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, st->bucket);
1975
1976                /* Lockless fast path for the common case of empty buckets */
1977                if (empty_bucket(st))
1978                        continue;
1979
1980                read_lock_bh(lock);
1981                sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) {
1982                        if (sk->sk_family != st->family ||
1983                            !net_eq(sock_net(sk), net)) {
1984                                continue;
1985                        }
1986                        rc = sk;
1987                        goto out;
1988                }
1989                st->state = TCP_SEQ_STATE_TIME_WAIT;
1990                inet_twsk_for_each(tw, node,
1991                                   &tcp_hashinfo.ehash[st->bucket].twchain) {
1992                        if (tw->tw_family != st->family ||
1993                            !net_eq(twsk_net(tw), net)) {
1994                                continue;
1995                        }
1996                        rc = tw;
1997                        goto out;
1998                }
1999                read_unlock_bh(lock);
2000                st->state = TCP_SEQ_STATE_ESTABLISHED;
2001        }
2002out:
2003        return rc;
2004}
2005
2006static void *established_get_next(struct seq_file *seq, void *cur)
2007{
2008        struct sock *sk = cur;
2009        struct inet_timewait_sock *tw;
2010        struct hlist_node *node;
2011        struct tcp_iter_state* st = seq->private;
2012        struct net *net = seq_file_net(seq);
2013
Show full sources