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:	Tue, 10 Feb 2009 00:03:43 +0000 (GMT)
From:	"Maciej W. Rozycki" <macro@...ux-mips.org>
To:	Roel Kluin <roel.kluin@...il.com>
cc:	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial: Z85C30: BCM1480: loops should end at 0

On Sun, 8 Feb 2009, Roel Kluin wrote:

> With a postfix decrement 'loops' reach -1, not 0, which is subsequently
> returned. In drivers/serial/zs.c, line 1137 it is considered as a boolean with 0
> as failure:
> 
> if (zs_transmit_drain(zport, irq))
>                 write_zsdata(zport, ch);
> 
> so to use it as such loops should end at 0 after the loop rather than -1.
> This also fix similar issues in other functions.
> 
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> Another solution would be to change the test at drivers/serial/zs.c, line 1137:
> 
> if (zs_transmit_drain(zport, irq) == -1)
> 
> Is that preferred?

 I'm tempted to rewrite these as do {} while loops instead.  Thanks for 
the report -- I'm running out of disk space on my development system 
again, so please allow me a couple of days to make a clean-up before I get 
back to your report.  The change has to be split into two separate 
patches, BTW.

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