#7449: Check for invalid Frame List Sizes and enable Asynchronous Park Capability [gsoc2011] --------------------------------+---------------------------- Reporter: gabriel.hartmann | Owner: mmlr Type: bug | Status: new Priority: normal | Milestone: R1 Component: Drivers/USB | Version: R1/Development Resolution: | Keywords: EHCI gsoc2011 Blocked By: | Blocking: Has a Patch: 1 | Platform: All --------------------------------+---------------------------- Comment (by bonefish): Replying to [comment:7 gabriel.hartmann]: > Would you consider early termination via a return statement to be generally desirable, or just within the scope of this particular situation? To add to what mmlr wrote, there are convenient scope-based (i.e. RAII) [https://dev.haiku- os.org/browser/haiku/trunk/headers/private/shared/AutoLocker.h AutoLocker] and [https://dev.haiku- os.org/browser/haiku/trunk/headers/private/shared/AutoDeleter.h AutoDeleter] classes which do not only simplify using the early-return style, but also help preventing programming errors like memory leaks and unbalanced locking. Both classes are rather flexible templates and already come with a bunch of handy specializations. For kernel locking needs a whole bunch of specializations is defined in [https://dev.haiku- os.org/browser/haiku/trunk/headers/private/kernel/util/AutoLock.h headers/private/kernel/util/AutoLock.h]. -- Ticket URL: <http://dev.haiku-os.org/ticket/7449#comment:10> Haiku <http://dev.haiku-os.org> Haiku - the operating system.