Showing error 1610

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


Source:

 336        BUG_ON(!PageLocked(page));
 337        count = page_mapcount(page);
 338        if (count <= 1 && PageSwapCache(page))
 339                count += page_swapcount(page);
 340        return count == 1;
 341}
 342
 343/*
 344 * Work out if there are any other processes sharing this
 345 * swap cache page. Free it if you can. Return success.
 346 */
 347static int remove_exclusive_swap_page_count(struct page *page, int count)
 348{
 349        int retval;
 350        struct swap_info_struct * p;
 351        swp_entry_t entry;
 352
 353        BUG_ON(PagePrivate(page));
 354        BUG_ON(!PageLocked(page));
 355
 356        if (!PageSwapCache(page))
 357                return 0;
 358        if (PageWriteback(page))
 359                return 0;
 360        if (page_count(page) != count) /* us + cache + ptes */
 361                return 0;
 362
 363        entry.val = page_private(page);
 364        p = swap_info_get(entry);
 365        if (!p)
 366                return 0;
 367
 368        /* Is the only swap cache user the cache itself? */
 369        retval = 0;
 370        if (p->swap_map[swp_offset(entry)] == 1) {
 371                /* Recheck the page count with the swapcache lock held.. */
 372                spin_lock_irq(&swapper_space.tree_lock);
 373                if ((page_count(page) == count) && !PageWriteback(page)) {
 374                        __delete_from_swap_cache(page);
 375                        SetPageDirty(page);
 376                        retval = 1;
Show full sources