relay: fix lock imbalance in relay_late_setup_files
authorJiri Slaby <jirislaby@gmail.com>
Sat, 17 Jan 2009 11:04:36 +0000 (12:04 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 16:28:16 +0000 (08:28 -0800)
commit b786c6a98ef6fa81114ba7b9fbfc0d67060775e3 upstream.

One fail path in relay_late_setup_files() omits
mutex_unlock(&relay_channels_mutex);
Add it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/relay.c

index 8d13a78..b0bbf6f 100644 (file)
@@ -664,8 +664,10 @@ int relay_late_setup_files(struct rchan *chan,
 
        mutex_lock(&relay_channels_mutex);
        /* Is chan already set up? */
-       if (unlikely(chan->has_base_filename))
+       if (unlikely(chan->has_base_filename)) {
+               mutex_unlock(&relay_channels_mutex);
                return -EEXIST;
+       }
        chan->has_base_filename = 1;
        chan->parent = parent;
        curr_cpu = get_cpu();