Showing error 1066

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: 2459
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

2429#define igmp_mcf_seq_private(seq)        ((struct igmp_mcf_iter_state *)(seq)->private)
2430
2431static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)
2432{
2433        struct ip_sf_list *psf = NULL;
2434        struct ip_mc_list *im = NULL;
2435        struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
2436
2437        state->idev = NULL;
2438        state->im = NULL;
2439        for_each_netdev(&init_net, state->dev) {
2440                struct in_device *idev;
2441                idev = in_dev_get(state->dev);
2442                if (unlikely(idev == NULL))
2443                        continue;
2444                read_lock(&idev->mc_list_lock);
2445                im = idev->mc_list;
2446                if (likely(im != NULL)) {
2447                        spin_lock_bh(&im->lock);
2448                        psf = im->sources;
2449                        if (likely(psf != NULL)) {
2450                                state->im = im;
2451                                state->idev = idev;
2452                                break;
2453                        }
2454                        spin_unlock_bh(&im->lock);
2455                }
2456                read_unlock(&idev->mc_list_lock);
2457                in_dev_put(idev);
2458        }
2459        return psf;
2460}
2461
2462static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_list *psf)
2463{
2464        struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq);
2465
2466        psf = psf->sf_next;
2467        while (!psf) {
2468                spin_unlock_bh(&state->im->lock);
2469                state->im = state->im->next;
Show full sources