Showing error 933

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: kernel/relay.c
Line in file: 667
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by b786c6a98ef6fa81114ba7b9fbfc0d67060775e3
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

 637
 638/**
 639 *        relay_late_setup_files - triggers file creation
 640 *        @chan: channel to operate on
 641 *        @base_filename: base name of files to create
 642 *        @parent: dentry of parent directory, %NULL for root directory
 643 *
 644 *        Returns 0 if successful, non-zero otherwise.
 645 *
 646 *        Use to setup files for a previously buffer-only channel.
 647 *        Useful to do early tracing in kernel, before VFS is up, for example.
 648 */
 649int relay_late_setup_files(struct rchan *chan,
 650                           const char *base_filename,
 651                           struct dentry *parent)
 652{
 653        int err = 0;
 654        unsigned int i, curr_cpu;
 655        unsigned long flags;
 656        struct dentry *dentry;
 657        struct rchan_percpu_buf_dispatcher disp;
 658
 659        if (!chan || !base_filename)
 660                return -EINVAL;
 661
 662        strlcpy(chan->base_filename, base_filename, NAME_MAX);
 663
 664        mutex_lock(&relay_channels_mutex);
 665        /* Is chan already set up? */
 666        if (unlikely(chan->has_base_filename))
 667                return -EEXIST;
 668        chan->has_base_filename = 1;
 669        chan->parent = parent;
 670        curr_cpu = get_cpu();
 671        /*
 672         * The CPU hotplug notifier ran before us and created buffers with
 673         * no files associated. So it's safe to call relay_setup_buf_file()
 674         * on all currently online CPUs.
 675         */
 676        for_each_online_cpu(i) {
 677                if (unlikely(!chan->buf[i])) {
Show full sources