protect writing to per_cpu_call_rcu_data[*]
authorLai Jiangshan <laijs@cn.fujitsu.com>
Thu, 15 Sep 2011 15:20:29 +0000 (11:20 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Sep 2011 15:20:29 +0000 (11:20 -0400)
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-call-rcu-impl.h

index 6e80fa98c8aea9ebd7a7a835ea8fa3c52546228e..c822646e03834bbf26224feae2a71bcdfb5bf8e1 100644 (file)
@@ -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;
 }
 
This page took 0.025453 seconds and 4 git commands to generate.