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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 9 Dec 2013 18:18:22 -0800
From:	Paul Walmsley <pwalmsley@...dia.com>
To:	Santosh Shilimkar <santosh.shilimkar@...com>,
	Viresh Kumar <viresh.kumar@...aro.org>
CC:	<linux-omap@...r.kernel.org>, <cpufreq@...r.kernel.org>,
	<linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] cpufreq: omap: clk_round_rate() can return a zero upon
 error


Treat both negative and zero return values from clk_round_rate() as 
errors.  This is needed since subsequent patches will convert 
clk_round_rate()'s return value to be an unsigned type, rather than a 
signed type, since some clock sources can generate rates higher than 
(2^31)-1 Hz.

Eventually, when calling clk_round_rate(), only a return value of
zero will be considered a error.  All other values will be
considered valid rates.  The comparison against values less than
0 is kept to preserve the correct behavior in the meantime.

This patch also removes a bogus usage of IS_ERR_VALUE(), which is intended 
to be used only on combination pointer/error code return values; a 
side-benefit.

Signed-off-by: Paul Walmsley <pwalmsley@...dia.com>
Cc: Santosh Shilimkar <santosh.shilimkar@...com>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
---
Applies on v3.13-rc3.  See also:

http://marc.info/?l=linux-arm-kernel&m=138542591313620&w=2

  drivers/cpufreq/omap-cpufreq.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index a0acd0bfba40..0f41eb2609f3 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -63,7 +63,7 @@ static int omap_target(struct cpufreq_policy *policy, unsigned int index)

  	freq = new_freq * 1000;
  	ret = clk_round_rate(mpu_clk, freq);
-	if (IS_ERR_VALUE(ret)) {
+	if (ret <= 0) {
  		dev_warn(mpu_dev,
  			 "CPUfreq: Cannot find matching frequency for %lu\n",
  			 freq);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ