Skip to content

Commit

Permalink
relay: fix lock imbalance in relay_late_setup_files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Ingo Molnar committed Jan 18, 2009
1 parent fdb6a8f commit b786c6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,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();
Expand Down

0 comments on commit b786c6a

Please sign in to comment.