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>] [day] [month] [year] [list]
Date:   Wed, 6 Apr 2022 09:46:28 +0800
From:   Liao Chang <liaochang1@...wei.com>
To:     <mingo@...hat.com>, <peterz@...radead.org>,
        <juri.lelli@...hat.com>, <vincent.guittot@...aro.org>,
        <dietmar.eggemann@....com>, <rostedt@...dmis.org>,
        <bsegall@...gle.com>, <mgorman@...e.de>, <bristot@...hat.com>
CC:     <linux-kernel@...r.kernel.org>, <hucool.lihua@...wei.com>,
        <w.f@...wei.com>, <liaochang1@...wei.com>
Subject: [PATCH] sched: Fix pointless comparison between unsigned int with zero

It is pointless to do a comparison bewteen unsigned variable and zero,
since validation routine requires the MSB of sysctl_sched_rt_period_ms
is 0, so casting variable to signed value before comparing with zero.

Signed-off-by: Liao Chang <liaochang1@...wei.com>
---
 kernel/sched/rt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 7b4f4fbbb404..58e105180e67 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2906,7 +2906,7 @@ static int sched_rt_global_constraints(void)
 
 static int sched_rt_global_validate(void)
 {
-	if (sysctl_sched_rt_period <= 0)
+	if ((int)sysctl_sched_rt_period <= 0)
 		return -EINVAL;
 
 	if ((sysctl_sched_rt_runtime != RUNTIME_INF) &&
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ