Showing error 976

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


Source:

 417
 418        if (is_migration_entry(entry))
 419                return;
 420
 421        p = swap_info_get(entry);
 422        if (p) {
 423                if (swap_entry_free(p, swp_offset(entry)) == 1) {
 424                        page = find_get_page(&swapper_space, entry.val);
 425                        if (page && !trylock_page(page)) {
 426                                page_cache_release(page);
 427                                page = NULL;
 428                        }
 429                }
 430                spin_unlock(&swap_lock);
 431        }
 432        if (page) {
 433                int one_user;
 434
 435                BUG_ON(PagePrivate(page));
 436                one_user = (page_count(page) == 2);
 437                /* Only cache user (+us), or swap space full? Free it! */
 438                /* Also recheck PageSwapCache after page is locked (above) */
 439                if (PageSwapCache(page) && !PageWriteback(page) &&
 440                                        (one_user || vm_swap_full())) {
 441                        delete_from_swap_cache(page);
 442                        SetPageDirty(page);
 443                }
 444                unlock_page(page);
 445                page_cache_release(page);
 446        }
 447}
 448
 449#ifdef CONFIG_HIBERNATION
 450/*
 451 * Find the swap type that corresponds to given device (if any).
 452 *
 453 * @offset - number of the PAGE_SIZE-sized block of the device, starting
 454 * from 0, in which the swap header is expected to be located.
 455 *
 456 * This is needed for the suspend to disk (aka swsusp).
 457 */
Show full sources