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]
Message-ID: <1260925516.1839.4.camel@rzhang1-desktop>
Date:	Wed, 16 Dec 2009 09:05:16 +0800
From:	Zhang Rui <rui.zhang@...el.com>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"Brown, Len" <len.brown@...el.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Matthew Garrett <mjg@...hat.com>
Subject: Re: [PATCH] thermal: Fix test of unsigned in
 thermal_cooling_device_cur_state_store()

On Wed, 2009-12-16 at 05:46 +0800, Roel Kluin wrote:
> state is unsigned long so the test did not work.
> 
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>

Acked-by: Zhang Rui <rui.zhang@...el.com>

> ---
> Found using coccinelle: http://coccinelle.lip6.fr/
> 
> Is this the best way to fix this?
> 
> diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
> index 6f8d8f9..800e0c5 100644
> --- a/drivers/thermal/thermal_sys.c
> +++ b/drivers/thermal/thermal_sys.c
> @@ -374,7 +374,7 @@ thermal_cooling_device_cur_state_store(struct device *dev,
>  	if (!sscanf(buf, "%ld\n", &state))
>  		return -EINVAL;
>  
> -	if (state < 0)
> +	if ((long)state < 0)
>  		return -EINVAL;
>  
>  	result = cdev->ops->set_cur_state(cdev, state);


--
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