Re: kobjects: mark cleaned up kobjects as unitialized

From: Greg KH
Date: Wed Nov 25 2009 - 10:41:24 EST


On Wed, Nov 25, 2009 at 07:27:47AM -0800, Greg KH wrote:
> > but basically you can demonstrate the problem with this simple code:
> >
> > struct device dev;
> > while(1) {
> > dev->release = dummy_release_function_that_does_nothing;
>
> WTF!!!
>
> Ugh, if I see one more person try to "trick" the kernel from reporting
> this error by providing a "dummy" release function, I'm going to go find
> a kitten to kick.
>
> Seriously, why are you blatently ignoring the warning that the kernel is
> trying to be nice and give to you? Do we just invent messages that need
> to be worked around?

Oh, and before anyone thinks that I'm being too harsh here, again, refer
to Documentation/kobject.txt:
Note that the kernel will warn you if you forget to provide a
release() method. Do not try to get rid of this warning by
providing an "empty" release function; you will be mocked
mercilessly by the kobject maintainer if you attempt this.

Hence my mocking.

thanks,

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