Showing error 974

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: fs/dcache.c
Line in file: 1878
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

1848                        if (IS_ROOT(alias)) {
1849                                spin_lock(&alias->d_lock);
1850                                __d_materialise_dentry(dentry, alias);
1851                                __d_drop(alias);
1852                                goto found;
1853                        }
1854                        /* Nope, but we must(!) avoid directory aliasing */
1855                        actual = __d_unalias(dentry, alias);
1856                        if (IS_ERR(actual))
1857                                dput(alias);
1858                        goto out_nolock;
1859                }
1860        }
1861
1862        /* Add a unique reference */
1863        actual = __d_instantiate_unique(dentry, inode);
1864        if (!actual)
1865                actual = dentry;
1866        else if (unlikely(!d_unhashed(actual)))
1867                goto shouldnt_be_hashed;
1868
1869found_lock:
1870        spin_lock(&actual->d_lock);
1871found:
1872        _d_rehash(actual);
1873        spin_unlock(&actual->d_lock);
1874        spin_unlock(&dcache_lock);
1875out_nolock:
1876        if (actual == dentry) {
1877                security_d_instantiate(dentry, inode);
1878                return NULL;
1879        }
1880
1881        iput(inode);
1882        return actual;
1883
1884shouldnt_be_hashed:
1885        spin_unlock(&dcache_lock);
1886        BUG();
1887}
1888
Show full sources