[i2c] [patch 2.6.26-rc1] i2c_use_client() defends against NULL
Trent Piepho
xyzzy at speakeasy.org
Sat May 17 19:53:32 CEST 2008
On Sat, 17 May 2008, David Brownell wrote:
> On Saturday 17 May 2008, Jean Delvare wrote:
> > On Sun, 4 May 2008 13:06:20 -0700, David Brownell wrote:
> > > Defend the i2c refcount calls against NULL pointers, as is important
> > > (and conventional) for such calls ... we don't want to morph NULL
> > > pointers into bogus non-null ones.
> >
> > Passing NULL to the current functions would just crash, it wouldn't
> > morph anything.
>
> That's only if you assume an MMU set up to cause oopsing on reference
> to the first and last pages of memory. Not the best of assumptions...
Maybe BUG_ON(!client) would be better? It seems more likely to catch
a programming error.
More information about the i2c
mailing list