lkml.org 
[lkml]   [2009]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files
    Date
    One fail path in relay_late_setup_files() omits
    mutex_unlock(&relay_channels_mutex);
    Add it.

    Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
    Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
    Cc: Jens Axboe <axboe@suse.de>
    ---
    kernel/relay.c | 4 +++-
    1 files changed, 3 insertions(+), 1 deletions(-)

    diff --git a/kernel/relay.c b/kernel/relay.c
    index 8ca1587..738bc85 100644
    --- a/kernel/relay.c
    +++ b/kernel/relay.c
    @@ -714,8 +714,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();
    --
    1.6.1
    caught by stanse

    \
     
     \ /
      Last update: 2009-01-17 12:07    [W:0.048 / U:0.088 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site