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:	Fri, 17 Oct 2014 18:10:54 +0000
From:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	David Laight <David.Laight@...LAB.COM>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 2/2] usb: dwc2: gadget: modify return statement

> From: Sudip Mukherjee [mailto:sudipm.mukherjee@...il.com]
> Sent: Friday, October 17, 2014 3:03 AM
> 
> On Fri, Oct 17, 2014 at 09:02:00AM +0000, David Laight wrote:
> > From: Of Sudip Mukherjee
> > > modified the function to have a single return statement at the end
> > > instead of multiple return statement in the middle of the function
> > > to improve the readability of the code.
> >
> > Many of us would disagree with you there.
> > Early returns actually make the code easier to read, certainly
> > better than a goto 'end of function'.
> >
> actually , frankly speaking, this first return statement was also easier for me to understand. But in
> my v1 patch , Paul mentioned :
> >For a long function like this, I'd rather keep a single return point at
> >the end.
> so I thought he meant all the return statements in the function.

What I didn't like about your first patch was that there were two
places where the spinlock was released. I think that is error-prone,
as can be seen by the original bug. But I am OK with leaving the
first return statement as-is, since the spinlock is not held there.

So I think we should apply patch 1, and drop patch 2.

-- 
Paul

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