RAS/CEC: Increment cec_entered under the mutex lock

Modify ->cec_entered in the critical section of the mutex.

Signed-off-by: WANG Chao <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: linux-edac <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
This commit is contained in:
WANG Chao 2019-04-18 03:41:14 +00:00 • committed by Borislav Petkov
commit 09cbd2197e

View file

@ -286,10 +286,10 @@ int cec_add_elem(u64 pfn)
if (!ce_arr.array || ce_arr.disabled)
return -ENODEV;
ca->ces_entered++;
mutex_lock(&ce_mutex);
ca->ces_entered++;
if (ca->n == MAX_ELEMS)
WARN_ON(!del_lru_elem_unlocked(ca));