Showing error 1484

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/udp.c
Line in file: 1556
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

1526        struct udp_iter_state *state = seq->private;
1527        struct net *net = seq_file_net(seq);
1528
1529        do {
1530                sk = sk_next(sk);
1531try_again:
1532                ;
1533        } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family));
1534
1535        if (!sk && ++state->bucket < UDP_HTABLE_SIZE) {
1536                sk = sk_head(state->hashtable + state->bucket);
1537                goto try_again;
1538        }
1539        return sk;
1540}
1541
1542static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos)
1543{
1544        struct sock *sk = udp_get_first(seq);
1545
1546        if (sk)
1547                while (pos && (sk = udp_get_next(seq, sk)) != NULL)
1548                        --pos;
1549        return pos ? NULL : sk;
1550}
1551
1552static void *udp_seq_start(struct seq_file *seq, loff_t *pos)
1553        __acquires(udp_hash_lock)
1554{
1555        read_lock(&udp_hash_lock);
1556        return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
1557}
1558
1559static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1560{
1561        struct sock *sk;
1562
1563        if (v == SEQ_START_TOKEN)
1564                sk = udp_get_idx(seq, 0);
1565        else
1566                sk = udp_get_next(seq, v);
Show full sources