[ofa-general] Re: PATCH 1/1 - fix kernel crash in mad.c whenIB_MAD_RESULT_(SUCCESS|CONSUMED) returned
Roland Dreier
rdreier at cisco.com
Tue May 20 15:37:37 PDT 2008
> >I also agree but I remember at one point we got pushback from
> >one of the mainline kernel developers who really wanted to see
> >only one return point in the code even if it meant more gotos.
> >I don't remember who though.
>
> I think the coding style document calls out using a single return point, but I
> don't think that's always the cleanest approach either.
CodingStyle suggests using goto to avoid duplicating cleaup code at
every return. I don't think anyone would argue in favor of the style
we're talking about here of using goto to jump to a plain return
statement. it doesn't help avoid bugs caused by missing cleanup, and
it actually *causes* bugs like the one here where it becomes easy to
forget what the function is returning.
- R.
More information about the general
mailing list