Showing error 1481

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


Source:

 871        struct raw_iter_state* state = raw_seq_private(seq);
 872
 873        do {
 874                sk = sk_next(sk);
 875try_again:
 876                ;
 877        } while (sk && sock_net(sk) != seq_file_net(seq));
 878
 879        if (!sk && ++state->bucket < RAW_HTABLE_SIZE) {
 880                sk = sk_head(&state->h->ht[state->bucket]);
 881                goto try_again;
 882        }
 883        return sk;
 884}
 885
 886static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos)
 887{
 888        struct sock *sk = raw_get_first(seq);
 889
 890        if (sk)
 891                while (pos && (sk = raw_get_next(seq, sk)) != NULL)
 892                        --pos;
 893        return pos ? NULL : sk;
 894}
 895
 896void *raw_seq_start(struct seq_file *seq, loff_t *pos)
 897{
 898        struct raw_iter_state *state = raw_seq_private(seq);
 899
 900        read_lock(&state->h->lock);
 901        return *pos ? raw_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
 902}
 903EXPORT_SYMBOL_GPL(raw_seq_start);
 904
 905void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 906{
 907        struct sock *sk;
 908
 909        if (v == SEQ_START_TOKEN)
 910                sk = raw_get_first(seq);
 911        else
Show full sources