Skip to content

Commit

Permalink
RAS/CEC: Increment cec_entered under the mutex lock
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
wcwxyz authored and suryasaimadhu committed Apr 20, 2019
1 parent 28156d7 commit 09cbd21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ras/cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 09cbd21

Please sign in to comment.