lkml.org 
[lkml]   [2007]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kobject: make sure kobj->ktype is set before kobject_init
On Wed, Nov 28, 2007 at 03:42:00PM -0500, Alan Stern wrote:
> This patch (as1020) adds a check to kobject_init() to insure that the
> ktype field is not NULL. This is just for safety's sake; as far as I
> know there are no remaining places where the field is left unset. But
> ironically, kset_init() did fail to set it! The patch fixes that and
> removes some redundant initialization in kset_createa().
>
> The patch also fixes up elevator_init(), where ktype was set after
> calling kobject_init() instead of before.

No, it's safe to set ktype after kobject_init, it was just not safe to
set the kset. As Kay pointed out, I just added a patch to my tree to
resolve this issue, and I'll go back and update the documentation now.

I do like the "check for a ktype" warning, I'll go add that to my local
tree and see what breaks. Odds are, all the static kobjects will :(

thanks,

greg k-h
-
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: 2007-11-28 22:49    [W:0.090 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site