lkml.org 
[lkml]   [2005]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] release_resource() check for NULL resource
From
Date
Hi,

On Mon, Oct 03, 2005 at 03:43:50PM +0300, Pekka Enberg wrote:
> > Many drivers have the release function copy-pasted to init with lots
> > of goto labels exactly because release_region, iounmap, and friends
> > aren't NULL safe.

On Mon, 2005-10-03 at 14:42 +0100, Al Viro wrote:
> Bullshit. I have waded through many, *many* initialization sequences
> like that. "Lots of goto labels" is _less_ prone to breakage when
> properly done; your variant begs for trouble upon the driver changes.
>
> Note that "lots of goto" is actually a cleaner control structure than
> what you propose - the amount of instances of offending statement is
> far from being the only metrics. The only things to verify with it are

Fair enough. Bad example from my part.

My main argument still remains. It is useful to handle NULL in some
release functions (iounmap and release_resource come to mind) because it
simplifies releasing a partially initialized state. Grep for NULL checks
around iounmap() and release_resource() calls for existing usage in the
drivers...

Pekka

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-03 17:00    [W:0.061 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site