Showing error 951

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


Source:

 840                ui->bulk_read = 1;
 841        }
 842
 843        /*
 844         * If possible, try to use pre-allocated bulk-read information, which
 845         * is protected by @c->bu_mutex.
 846         */
 847        if (mutex_trylock(&c->bu_mutex))
 848                bu = &c->bu;
 849        else {
 850                bu = kmalloc(sizeof(struct bu_info), GFP_NOFS | __GFP_NOWARN);
 851                if (!bu)
 852                        goto out_unlock;
 853
 854                bu->buf = NULL;
 855                allocated = 1;
 856        }
 857
 858        bu->buf_len = c->max_bu_buf_len;
 859        data_key_init(c, &bu->key, inode->i_ino,
 860                      page->index << UBIFS_BLOCKS_PER_PAGE_SHIFT);
 861        err = ubifs_do_bulk_read(c, bu, page);
 862
 863        if (!allocated)
 864                mutex_unlock(&c->bu_mutex);
 865        else
 866                kfree(bu);
 867
 868out_unlock:
 869        mutex_unlock(&ui->ui_mutex);
 870        return err;
 871}
 872
 873static int ubifs_readpage(struct file *file, struct page *page)
 874{
 875        if (ubifs_bulk_read(page))
 876                return 0;
 877        do_readpage(page);
 878        unlock_page(page);
 879        return 0;
 880}
Show full sources