relay: fix lock imbalance in relay_late_setup_files
PATCH 1/1 relay: fix lock imbalance in relay_late_setup_files
One fail path in relay_late_setup_files() omitsmutex_unlock(&relay_channels_mutex);
Add it.
Signed-off-by Jiri Slaby <[email protected]>
Cc Eduard - Gabriel Munteanu <[email protected]>
Cc Jens Axboe <[email protected]>
--- kernel/relay.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/relay.c +3 -1
@@ -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 ();
Signature · 2 lines
1.6.1 caught by stanse
Quoted 7 lines · Jiri Slaby
One fail path in
relay_late_setup_files()omitsmutex_unlock(&relay_channels_mutex);
Add it.Signed-off-by Jiri Slaby <[email protected]>Cc Eduard - Gabriel Munteanu <[email protected]>Cc Jens Axboe <[email protected]>
Oh, I missed that. Looks good to me.
Thanks,
Eduard
Quoted 10 lines · Jiri Slaby
One fail path in
relay_late_setup_files()omitsmutex_unlock(&relay_channels_mutex);
Add it.Signed-off-by Jiri Slaby <[email protected]>Cc Eduard - Gabriel Munteanu <[email protected]>Cc Jens Axboe <[email protected]>--- kernel/relay.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
Looks good, applied!
Quoted 25 lines
kernel/relay.c +3
-1@@ -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 ();Signature · 7 lines
1.6.1 caught by stanse -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Signature · 1 line
Jens Axboe