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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Apr 2013 21:21:34 +0200
From:	Marc Kleine-Budde <mkl@...gutronix.de>
To:	Christoph Fritz <chf.fritz@...glemail.com>
CC:	Wolfgang Grandegger <wg@...ndegger.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Andreas Larsson <andreas@...sler.com>,
	"Hans J. Koch" <hjk@...sjkoch.de>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Bill Pemberton <wfp5p@...ginia.edu>, linux-can@...r.kernel.org,
	Daniel Mack <daniel@...que.org>
Subject: Re: [PATCH v3] can: sja1000: fix endian on arm

On 04/11/2013 09:14 PM, Christoph Fritz wrote:
> To get correct endian on arm cpus while reading device tree properties,
> this patch replaces of_get_property() with of_property_read_u32().
> 
> Signed-off-by: Christoph Fritz <chf.fritz@...glemail.com>

[...]

> -	prop = of_get_property(np, "nxp,clock-out-frequency", &prop_size);
> -	if (prop && (prop_size == sizeof(u32)) && *prop) {
> -		u32 divider = priv->can.clock.freq * 2 / *prop;
> +	err = of_property_read_u32(np, "nxp,clock-out-frequency", &prop);
> +	if (!err) {

What about checking for "prop != 0" as the original code does?

> +		u32 divider = priv->can.clock.freq * 2 / prop;

To prevent a potential div-by-zero here?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


Download attachment "signature.asc" of type "application/pgp-signature" (264 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ