Showing error 1490

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: 448
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

418#ifdef CONFIG_PROC_FS
419struct ac6_iter_state {
420        struct seq_net_private p;
421        struct net_device *dev;
422        struct inet6_dev *idev;
423};
424
425#define ac6_seq_private(seq)        ((struct ac6_iter_state *)(seq)->private)
426
427static inline struct ifacaddr6 *ac6_get_first(struct seq_file *seq)
428{
429        struct ifacaddr6 *im = NULL;
430        struct ac6_iter_state *state = ac6_seq_private(seq);
431        struct net *net = seq_file_net(seq);
432
433        state->idev = NULL;
434        for_each_netdev(net, state->dev) {
435                struct inet6_dev *idev;
436                idev = in6_dev_get(state->dev);
437                if (!idev)
438                        continue;
439                read_lock_bh(&idev->lock);
440                im = idev->ac_list;
441                if (im) {
442                        state->idev = idev;
443                        break;
444                }
445                read_unlock_bh(&idev->lock);
446                in6_dev_put(idev);
447        }
448        return im;
449}
450
451static struct ifacaddr6 *ac6_get_next(struct seq_file *seq, struct ifacaddr6 *im)
452{
453        struct ac6_iter_state *state = ac6_seq_private(seq);
454
455        im = im->aca_next;
456        while (!im) {
457                if (likely(state->idev != NULL)) {
458                        read_unlock_bh(&state->idev->lock);
Show full sources