Linux-EDAC Archive on
 help / color / Atom feed
* [tip:ras/core] RAS/CEC: Do not set decay value on error
@ 2019-06-08 21:26 tip-bot for Borislav Petkov
  0 siblings, 0 replies; only message in thread
From: tip-bot for Borislav Petkov @ 2019-06-08 21:26 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tony.luck, mingo, tglx, linux-edac, bp, hpa

Commit-ID:  5cc6b16ea1313d05956b55e83a1f753c604282a8
Author:     Borislav Petkov <>
AuthorDate: Sat, 20 Apr 2019 21:33:08 +0200
Committer:  Borislav Petkov <>
CommitDate: Sat, 8 Jun 2019 17:34:36 +0200

RAS/CEC: Do not set decay value on error

When the value requested doesn't match the allowed (min,max) range,
the @data buffer should not be modified with the invalid value because
reading "decay_interval" shows it otherwise as if the previous write

Move the data write after the check.

Signed-off-by: Borislav Petkov <>
Cc: Tony Luck <>
Cc: linux-edac <>
 drivers/ras/cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
index 73a975c26f9f..31868bd99e8d 100644
--- a/drivers/ras/cec.c
+++ b/drivers/ras/cec.c
@@ -371,17 +371,17 @@ DEFINE_DEBUGFS_ATTRIBUTE(pfn_ops, u64_get, pfn_set, "0x%llx\n");
 static int decay_interval_set(void *data, u64 val)
-	*(u64 *)data = val;
 		return -EINVAL;
 		return -EINVAL;
+	*(u64 *)data   = val;
 	decay_interval = val;
 	return 0;
 DEFINE_DEBUGFS_ATTRIBUTE(decay_interval_ops, u64_get, decay_interval_set, "%lld\n");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-08 21:26 [tip:ras/core] RAS/CEC: Do not set decay value on error tip-bot for Borislav Petkov

Linux-EDAC Archive on

Archives are clonable:
	git clone --mirror linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ \
	public-inbox-index linux-edac

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox