RAS/CEC: Check count_threshold unconditionally
authorBorislav Petkov <bp@suse.de>
Sat, 20 Apr 2019 12:06:37 +0000 (14:06 +0200)
committerBorislav Petkov <bp@suse.de>
Sat, 8 Jun 2019 15:33:10 +0000 (17:33 +0200)
commitde0e0624d86ff9fc512dedb297f8978698abf21a
tree28d6d96ec9e4765a65a096cf1e26d0611e929193
parent6d8e294bf5f0e85c34e8b14b064e2965f53f38b0
RAS/CEC: Check count_threshold unconditionally

The count_threshold should be checked unconditionally, after insertion
too, so that a count_threshold value of 1 can cause an immediate
offlining. I.e., offline the page on the *first* error encountered.

Add comments to make it clear what cec_add_elem() does, while at it.

Reported-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@vger.kernel.org
Link: https://lkml.kernel.org/r/20190418034115.75954-3-chao.wang@ucloud.cn
drivers/ras/cec.c