diff options
author | WANG Chao <chao.wang@ucloud.cn> | 2019-04-17 23:41:14 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2019-04-20 06:16:52 -0400 |
commit | 09cbd2197e9291d6a3d3f42873f06ca1f388c1a4 (patch) | |
tree | 5626f4de88e0d5341a7b9d86f4aa5d16d226c50f | |
parent | 28156d7678431312b463361b23a218a1b5645ba5 (diff) |
RAS/CEC: Increment cec_entered under the mutex lock
Modify ->cec_entered in the critical section of the mutex.
Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: https://lkml.kernel.org/r/20190418034115.75954-2-chao.wang@ucloud.cn
-rw-r--r-- | drivers/ras/cec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index 2d9ec378a8bc..88e4f3ff0cb8 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c | |||
@@ -286,10 +286,10 @@ int cec_add_elem(u64 pfn) | |||
286 | if (!ce_arr.array || ce_arr.disabled) | 286 | if (!ce_arr.array || ce_arr.disabled) |
287 | return -ENODEV; | 287 | return -ENODEV; |
288 | 288 | ||
289 | ca->ces_entered++; | ||
290 | |||
291 | mutex_lock(&ce_mutex); | 289 | mutex_lock(&ce_mutex); |
292 | 290 | ||
291 | ca->ces_entered++; | ||
292 | |||
293 | if (ca->n == MAX_ELEMS) | 293 | if (ca->n == MAX_ELEMS) |
294 | WARN_ON(!del_lru_elem_unlocked(ca)); | 294 | WARN_ON(!del_lru_elem_unlocked(ca)); |
295 | 295 | ||