Showing error 1716

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: mm/filemap_xip.c
Line in file: 210
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 19:10:05 UTC


Source:

180        page = __xip_sparse_page;
181        if (!page)
182                return;
183
184retry:
185        spin_lock(&mapping->i_mmap_lock);
186        vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
187                mm = vma->vm_mm;
188                address = vma->vm_start +
189                        ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
190                BUG_ON(address < vma->vm_start || address >= vma->vm_end);
191                pte = page_check_address(page, mm, address, &ptl, 1);
192                if (pte) {
193                        /* Nuke the page table entry. */
194                        flush_cache_page(vma, address, pte_pfn(*pte));
195                        pteval = ptep_clear_flush_notify(vma, address, pte);
196                        page_remove_rmap(page, vma);
197                        dec_mm_counter(mm, file_rss);
198                        BUG_ON(pte_dirty(pteval));
199                        pte_unmap_unlock(pte, ptl);
200                        page_cache_release(page);
201                }
202        }
203        spin_unlock(&mapping->i_mmap_lock);
204
205        if (locked) {
206                mutex_unlock(&xip_sparse_mutex);
207        } else if (read_seqcount_retry(&xip_sparse_seq, count)) {
208                mutex_lock(&xip_sparse_mutex);
209                locked = 1;
210                goto retry;
211        }
212}
213
214/*
215 * xip_fault() is invoked via the vma operations vector for a
216 * mapped memory region to read in file data during a page fault.
217 *
218 * This function is derived from filemap_fault, but used for execute in place
219 */
220static int xip_file_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
Show full sources