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-prev] [day] [month] [year] [list]
Date:	Wed, 17 Feb 2016 15:32:08 +0000
From:	Punit Agrawal <punit.agrawal@....com>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc:	Eduardo Valentin <edubezval@...il.com>,
	Zhang Rui <rui.zhang@...el.com>, linux-kernel@...r.kernel.org,
	linux-pm@...r.kernel.org
Subject: Re: [PATCH] thermal: devfreq_cooling: remove impossible condition

Sudip Mukherjee <sudipm.mukherjee@...il.com> writes:

> state is an unsigned long and can never be less than 0.
>
> Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
> ---
>  drivers/thermal/devfreq_cooling.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
> index 01f0015..81631b1 100644
> --- a/drivers/thermal/devfreq_cooling.c
> +++ b/drivers/thermal/devfreq_cooling.c
> @@ -312,7 +312,7 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
>  	unsigned long freq;
>  	u32 static_power;
>  
> -	if (state < 0 || state >= dfc->freq_table_size)
> +	if (state >= dfc->freq_table_size)
>  		return -EINVAL;
>  
>  	freq = dfc->freq_table[state];

Makes sense.

Acked-by: Punit Agrawal <punit.agrawal@....com>

Thanks for sending the fix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ