Showing error 1491

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


Source:

458                        read_unlock_bh(&state->idev->lock);
459                        in6_dev_put(state->idev);
460                }
461                state->dev = next_net_device(state->dev);
462                if (!state->dev) {
463                        state->idev = NULL;
464                        break;
465                }
466                state->idev = in6_dev_get(state->dev);
467                if (!state->idev)
468                        continue;
469                read_lock_bh(&state->idev->lock);
470                im = state->idev->ac_list;
471        }
472        return im;
473}
474
475static struct ifacaddr6 *ac6_get_idx(struct seq_file *seq, loff_t pos)
476{
477        struct ifacaddr6 *im = ac6_get_first(seq);
478        if (im)
479                while (pos && (im = ac6_get_next(seq, im)) != NULL)
480                        --pos;
481        return pos ? NULL : im;
482}
483
484static void *ac6_seq_start(struct seq_file *seq, loff_t *pos)
485        __acquires(dev_base_lock)
486{
487        read_lock(&dev_base_lock);
488        return ac6_get_idx(seq, *pos);
489}
490
491static void *ac6_seq_next(struct seq_file *seq, void *v, loff_t *pos)
492{
493        struct ifacaddr6 *im;
494        im = ac6_get_next(seq, v);
495        ++*pos;
496        return im;
497}
498
Show full sources