Showing error 1489

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


Source:

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);
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}
Show full sources