Re: [PATCH 3/4] kobject: validate ktype release function during add

From: Greg Kroah-Hartman
Date: Sat Mar 11 2023 - 03:11:05 EST


On Sat, Mar 11, 2023 at 03:14:48AM +0000, Thomas Weißschuh wrote:
> Validating the ktype during cleanup is suboptimal.
> Many kobjects are only destroyed during shutdown which makes it hard to
> observe the messages.
>
> Instead perform the validation when the object is added.

As much as I would like to do this, it will cause way too many
false-positives at this point in time, sorry.

Yes, kobjects should always have a release function, but for some, they
are static structures and so do not have them, which is why we only
report the problem when the object is going away as that is when it
matters.

So if you fix up all the in-kernel static kobjects first, then we can
take this type of change, sorry.

Your first 2 are great though, I'll go queue them up next week, thanks
for the cleanups there.

greg k-h