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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1234216124.5574.12.camel@brick>
Date:	Mon, 09 Feb 2009 13:48:44 -0800
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	Evgeniy Polyakov <zbr@...emap.net>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Ian Dall <ian@...are.dropbear.id.au>
Subject: Re: [1/1] w1: w1 temp calculation overflow fix.

On Tue, 2009-02-10 at 00:42 +0300, Evgeniy Polyakov wrote:
> Signed-off-by: Ian Dall <ian@...are.dropbear.id.au>
> Signed-off-by: Evgeniy Polyakov <zbr@...emap.net>
> 
> diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
> index 2c8dff9..1ed3d55 100644
> --- a/drivers/w1/slaves/w1_therm.c
> +++ b/drivers/w1/slaves/w1_therm.c
> @@ -115,7 +115,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
>  
>  static inline int w1_DS18B20_convert_temp(u8 rom[9])
>  {
> -	s16 t = (rom[1] << 8) | rom[0];
> +	int t = ((s16)rom[1] << 8) | rom[0];

Alternatively,

	int t = (s16)le16_to_cpup((__le16 *)rom);

Cheers,

Harvey

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