Showing error 1612

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/ipmr.c
Line in file: 1783
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

1753
1754static int ipmr_vif_open(struct inode *inode, struct file *file)
1755{
1756        return seq_open_private(file, &ipmr_vif_seq_ops,
1757                        sizeof(struct ipmr_vif_iter));
1758}
1759
1760static const struct file_operations ipmr_vif_fops = {
1761        .owner         = THIS_MODULE,
1762        .open    = ipmr_vif_open,
1763        .read    = seq_read,
1764        .llseek  = seq_lseek,
1765        .release = seq_release_private,
1766};
1767
1768struct ipmr_mfc_iter {
1769        struct mfc_cache **cache;
1770        int ct;
1771};
1772
1773
1774static struct mfc_cache *ipmr_mfc_seq_idx(struct ipmr_mfc_iter *it, loff_t pos)
1775{
1776        struct mfc_cache *mfc;
1777
1778        it->cache = mfc_cache_array;
1779        read_lock(&mrt_lock);
1780        for (it->ct = 0; it->ct < MFC_LINES; it->ct++)
1781                for (mfc = mfc_cache_array[it->ct]; mfc; mfc = mfc->next)
1782                        if (pos-- == 0)
1783                                return mfc;
1784        read_unlock(&mrt_lock);
1785
1786        it->cache = &mfc_unres_queue;
1787        spin_lock_bh(&mfc_unres_lock);
1788        for (mfc = mfc_unres_queue; mfc; mfc = mfc->next)
1789                if (pos-- == 0)
1790                        return mfc;
1791        spin_unlock_bh(&mfc_unres_lock);
1792
1793        it->cache = NULL;
Show full sources