lkml.org 
[lkml]   [2008]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Mark kobjects as unitialized
On Sun, Mar 09, 2008 at 11:49:26AM +0100, Mikael Pettersson wrote:
> Balaji Rao writes:
> > Yes the idea works. One more memset is needed in sysdev_register. Here's the final patch.
> >
> > diff --git a/drivers/base/sys.c b/drivers/base/sys.c
> > index 2f79c55..7c839d9 100644
> > --- a/drivers/base/sys.c
> > +++ b/drivers/base/sys.c
> > @@ -133,6 +133,7 @@ int sysdev_class_register(struct sysdev_class * cls)
> > pr_debug("Registering sysdev class '%s'\n",
> > kobject_name(&cls->kset.kobj));
> > INIT_LIST_HEAD(&cls->drivers);
> > + memset(&cls->kset.kobj, 0x00, sizeof(struct kobject));
> > cls->kset.kobj.parent = &system_kset->kobj;
> > cls->kset.kobj.ktype = &ktype_sysdev_class;
> > cls->kset.kobj.kset = system_kset;
> > @@ -227,6 +228,7 @@ int sysdev_register(struct sys_device * sysdev)
> >
> > pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj));
> >
> > + memset(&sysdev->kobj, 0x00, sizeof(struct kobject));
> > /* Make sure the kset is set */
> > sysdev->kobj.kset = &cls->kset;
> >
>
> Thanks, 2.6.25-rc4 + these two memset()s is finally stable for
> me with no warnings, BUG()s, or panics.
>
> (However, the patch is whitespace damaged with initial tabs
> converted to spaces.)
>
> If you want to pass this on to Linus, you can add a
>
> Tested-by: Mikael Pettersson <mikpe@it.uu.se>

Thanks for testing.

greg k-h


\
 
 \ /
  Last update: 2008-03-10 18:27    [W:0.049 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site