Showing error 1475

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


Source:

 935out:
 936        iter->pos++;
 937        return fa;
 938}
 939
 940static struct fib_alias *fib_get_idx(struct seq_file *seq, loff_t pos)
 941{
 942        struct fib_iter_state *iter = seq->private;
 943        struct fib_alias *fa;
 944
 945        if (iter->valid && pos >= iter->pos && iter->genid == fib_hash_genid) {
 946                fa   = iter->fa;
 947                pos -= iter->pos;
 948        } else
 949                fa = fib_get_first(seq);
 950
 951        if (fa)
 952                while (pos && (fa = fib_get_next(seq)))
 953                        --pos;
 954        return pos ? NULL : fa;
 955}
 956
 957static void *fib_seq_start(struct seq_file *seq, loff_t *pos)
 958        __acquires(fib_hash_lock)
 959{
 960        void *v = NULL;
 961
 962        read_lock(&fib_hash_lock);
 963        if (fib_get_table(seq_file_net(seq), RT_TABLE_MAIN))
 964                v = *pos ? fib_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
 965        return v;
 966}
 967
 968static void *fib_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 969{
 970        ++*pos;
 971        return v == SEQ_START_TOKEN ? fib_get_first(seq) : fib_get_next(seq);
 972}
 973
 974static void fib_seq_stop(struct seq_file *seq, void *v)
 975        __releases(fib_hash_lock)
Show full sources