From: Mathieu Desnoyers Date: Sun, 13 Nov 2011 17:21:06 +0000 (-0500) Subject: ust_app_find_by_pid: move rcu_read_unlock to error label X-Git-Tag: v2.0-pre15~129 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ee2fd646b05ccdf3afc4ad784be259cb1f382539;p=lttng-tools.git ust_app_find_by_pid: move rcu_read_unlock to error label Less error-prone than read unlock within the code, as proven by commit 1e3a10e37a519046fd49c77f2fa23807b132f330. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index 0cc19481c..99fd84f3e 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -151,7 +151,6 @@ struct ust_app *ust_app_find_by_pid(pid_t pid) node = hashtable_lookup(ust_app_ht, (void *)((unsigned long) pid), sizeof(void *), &iter); if (node == NULL) { - rcu_read_unlock(); DBG2("UST app no found with pid %d", pid); goto error; } @@ -162,6 +161,7 @@ struct ust_app *ust_app_find_by_pid(pid_t pid) return caa_container_of(node, struct ust_app, node); error: + rcu_read_unlock(); return NULL; }