From: Lai Jiangshan Date: Thu, 15 Sep 2011 15:20:29 +0000 (-0400) Subject: protect writing to per_cpu_call_rcu_data[*] X-Git-Tag: v0.6.5~15 X-Git-Url: https://git.lttng.org/?p=urcu.git;a=commitdiff_plain;h=3670fef2faef63803d62a08f2aa4f089f3858b50 protect writing to per_cpu_call_rcu_data[*] Signed-off-by: Lai Jiangshan Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index 6e80fa9..c822646 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -396,12 +396,13 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp) errno = EINVAL; return -EINVAL; } - call_rcu_unlock(&call_rcu_mutex); if (per_cpu_call_rcu_data == NULL) { + call_rcu_unlock(&call_rcu_mutex); errno = ENOMEM; return -ENOMEM; } per_cpu_call_rcu_data[cpu] = crdp; + call_rcu_unlock(&call_rcu_mutex); return 0; }