Showing error 964

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


Source:

 963        }
 964        if (ptr)
 965                shmem_swp_unmap(ptr);
 966        spin_unlock(&info->lock);
 967        radix_tree_preload_end();
 968out:
 969        unlock_page(page);
 970        page_cache_release(page);
 971        iput(inode);                /* allows for NULL */
 972        return error;
 973}
 974
 975/*
 976 * shmem_unuse() search for an eventually swapped out shmem page.
 977 */
 978int shmem_unuse(swp_entry_t entry, struct page *page)
 979{
 980        struct list_head *p, *next;
 981        struct shmem_inode_info *info;
 982        int found = 0;
 983
 984        mutex_lock(&shmem_swaplist_mutex);
 985        list_for_each_safe(p, next, &shmem_swaplist) {
 986                info = list_entry(p, struct shmem_inode_info, swaplist);
 987                found = shmem_unuse_inode(info, entry, page);
 988                cond_resched();
 989                if (found)
 990                        goto out;
 991        }
 992        mutex_unlock(&shmem_swaplist_mutex);
 993out:        return found;        /* 0 or 1 or -ENOMEM */
 994}
 995
 996/*
 997 * Move the page from the page cache to the swap cache.
 998 */
 999static int shmem_writepage(struct page *page, struct writeback_control *wbc)
1000{
1001        struct shmem_inode_info *info;
1002        swp_entry_t *entry, swap;
1003        struct address_space *mapping;
Show full sources