Showing error 1478

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


Source:

2313                        read_unlock(&state->in_dev->mc_list_lock);
2314                        in_dev_put(state->in_dev);
2315                }
2316                state->dev = next_net_device(state->dev);
2317                if (!state->dev) {
2318                        state->in_dev = NULL;
2319                        break;
2320                }
2321                state->in_dev = in_dev_get(state->dev);
2322                if (!state->in_dev)
2323                        continue;
2324                read_lock(&state->in_dev->mc_list_lock);
2325                im = state->in_dev->mc_list;
2326        }
2327        return im;
2328}
2329
2330static struct ip_mc_list *igmp_mc_get_idx(struct seq_file *seq, loff_t pos)
2331{
2332        struct ip_mc_list *im = igmp_mc_get_first(seq);
2333        if (im)
2334                while (pos && (im = igmp_mc_get_next(seq, im)) != NULL)
2335                        --pos;
2336        return pos ? NULL : im;
2337}
2338
2339static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos)
2340        __acquires(dev_base_lock)
2341{
2342        read_lock(&dev_base_lock);
2343        return *pos ? igmp_mc_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
2344}
2345
2346static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2347{
2348        struct ip_mc_list *im;
2349        if (v == SEQ_START_TOKEN)
2350                im = igmp_mc_get_first(seq);
2351        else
2352                im = igmp_mc_get_next(seq, v);
2353        ++*pos;
Show full sources