Showing error 958

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: 1790
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

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;
1794        return NULL;
1795}
1796
1797
1798static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos)
1799{
1800        struct ipmr_mfc_iter *it = seq->private;
Show full sources