From 5485f82241185e6703fe343704c48d2a6d6a4b46 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 5 Nov 2011 11:31:24 -0400 Subject: [PATCH] Add missing rcu_read_unlock on error paths Signed-off-by: Mathieu Desnoyers --- lttng-sessiond/context.c | 2 ++ lttng-sessiond/ust-consumer.c | 1 + 2 files changed, 3 insertions(+) diff --git a/lttng-sessiond/context.c b/lttng-sessiond/context.c index d93a2895d..732dc929d 100644 --- a/lttng-sessiond/context.c +++ b/lttng-sessiond/context.c @@ -260,12 +260,14 @@ static int add_ustctx_all_channels(struct ltt_ust_session *ustsession, // ustctx, ustchan->obj, &context_data); if (ret < 0) { ret = LTTCOMM_UST_CONTEXT_FAIL; + rcu_read_unlock(); goto error; } } else { ret = add_ustctx_to_event(ustsession, ustctx, ustchan, event_name); if (ret < 0) { ret = LTTCOMM_UST_CONTEXT_FAIL; + rcu_read_unlock(); goto error; } else if (ret == 1) { /* Event found and context added */ diff --git a/lttng-sessiond/ust-consumer.c b/lttng-sessiond/ust-consumer.c index 444ff6eee..b83fcc435 100644 --- a/lttng-sessiond/ust-consumer.c +++ b/lttng-sessiond/ust-consumer.c @@ -171,6 +171,7 @@ int ust_consumer_send_session(int consumer_fd, struct ust_app_session *usess) ret = send_channel_streams(sock, uchan); if (ret < 0) { + rcu_read_unlock(); goto error; } hashtable_get_next(usess->channels, &iter); -- 2.34.1