lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Oct 2022 12:44:58 +0000
From:   Eliav Farber <farbere@...zon.com>
To:     <bp@...en8.de>, <mchehab@...nel.org>, <tony.luck@...el.com>,
        <james.morse@....com>, <rric@...nel.org>,
        <linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <talel@...zon.com>, <jonnyc@...zon.com>, <hhhawa@...zon.com>,
        <hanochu@...zon.com>, <farbere@...zon.com>, <itamark@...zon.com>,
        <shellykz@...zon.com>, <amitlavi@...zon.com>, <dkl@...zon.com>
Subject: [PATCH v2] edac: fix period calculation in edac_device_reset_delay_period()

Fix period calculation in case user sets a value of 1000.
The input of round_jiffies_relative() should be in jiffies and not in
milli-seconds.

Signed-off-by: Eliav Farber <farbere@...zon.com>
---
v2 --> v1:
- Fix the bug without modifying jiffs which is used to set
  edac_dev->delay.

 drivers/edac/edac_device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c
index 19522c568aa5..e944dd9b3593 100644
--- a/drivers/edac/edac_device.c
+++ b/drivers/edac/edac_device.c
@@ -398,13 +398,13 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev,
 {
 	unsigned long jiffs = msecs_to_jiffies(value);
 
-	if (value == 1000)
-		jiffs = round_jiffies_relative(value);
-
 	edac_dev->poll_msec = value;
 	edac_dev->delay	    = jiffs;
 
-	edac_mod_work(&edac_dev->work, jiffs);
+	if (value == 1000)
+		edac_mod_work(&edac_dev->work, round_jiffies_relative(jiffs));
+	else
+		edac_mod_work(&edac_dev->work, jiffs);
 }
 
 int edac_device_alloc_index(void)
-- 
2.37.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ