Showing error 1485

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


Source:

 43
 44static struct hlist_node *ct_get_next(struct seq_file *seq,
 45                                      struct hlist_node *head)
 46{
 47        struct net *net = seq_file_net(seq);
 48        struct ct_iter_state *st = seq->private;
 49
 50        head = rcu_dereference(head->next);
 51        while (head == NULL) {
 52                if (++st->bucket >= nf_conntrack_htable_size)
 53                        return NULL;
 54                head = rcu_dereference(net->ct.hash[st->bucket].first);
 55        }
 56        return head;
 57}
 58
 59static struct hlist_node *ct_get_idx(struct seq_file *seq, loff_t pos)
 60{
 61        struct hlist_node *head = ct_get_first(seq);
 62
 63        if (head)
 64                while (pos && (head = ct_get_next(seq, head)))
 65                        pos--;
 66        return pos ? NULL : head;
 67}
 68
 69static void *ct_seq_start(struct seq_file *seq, loff_t *pos)
 70        __acquires(RCU)
 71{
 72        rcu_read_lock();
 73        return ct_get_idx(seq, *pos);
 74}
 75
 76static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
 77{
 78        (*pos)++;
 79        return ct_get_next(s, v);
 80}
 81
 82static void ct_seq_stop(struct seq_file *s, void *v)
 83        __releases(RCU)
Show full sources