Showing error 997

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/xfs/xfs_mru_cache.c
Line in file: 592
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Undetermined 1
Entered: 2012-03-02 21:35:18 UTC


Source:

562
563        return elem ? elem->value : NULL;
564}
565
566/*
567 * To look up an element using its key, but leave its location in the internal
568 * lists alone, call xfs_mru_cache_peek().  If the element isn't found, this
569 * function returns NULL.
570 *
571 * See the comments above the declaration of the xfs_mru_cache_lookup() function
572 * for important locking information pertaining to this call.
573 */
574void *
575xfs_mru_cache_peek(
576        xfs_mru_cache_t        *mru,
577        unsigned long        key)
578{
579        xfs_mru_cache_elem_t *elem;
580
581        ASSERT(mru && mru->lists);
582        if (!mru || !mru->lists)
583                return NULL;
584
585        spin_lock(&mru->lock);
586        elem = radix_tree_lookup(&mru->store, key);
587        if (!elem)
588                spin_unlock(&mru->lock);
589        else
590                __release(mru_lock); /* help sparse not be stupid */
591
592        return elem ? elem->value : NULL;
593}
594
595/*
596 * To release the internal data structure spinlock after having performed an
597 * xfs_mru_cache_lookup() or an xfs_mru_cache_peek(), call xfs_mru_cache_done()
598 * with the data store pointer.
599 */
600void
601xfs_mru_cache_done(
602        xfs_mru_cache_t        *mru) __releases(mru->lock)
Show full sources