From: Mikael Pettersson <mikpe@it.uu.se>
To: Balaji Rao <balajirrao@gmail.com>
Cc: Greg KH <gregkh@suse.de>, Mikael Pettersson <mikpe@it.uu.se>,
kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Mark kobjects as unitialized
Date: Sun, 9 Mar 2008 11:49:26 +0100 [thread overview]
Message-ID: <18387.49334.235230.751065@harpo.it.uu.se> (raw)
In-Reply-To: <200803091251.15428.balajirrao@gmail.com>
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>
/Mikael
next prev parent reply other threads:[~2008-03-09 10:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 16:53 Balaji Rao
2008-03-06 17:05 ` Greg KH
2008-03-06 17:50 ` Balaji Rao
2008-03-06 18:05 ` Greg KH
2008-03-07 8:56 ` [kvm-devel] " Avi Kivity
2008-03-08 22:07 ` Balaji Rao
2008-03-09 5:06 ` Greg KH
2008-03-09 6:16 ` Greg KH
2008-03-09 6:17 ` Balaji Rao
2008-03-09 6:33 ` Greg KH
2008-03-09 6:36 ` Balaji Rao
2008-03-09 7:03 ` Greg KH
2008-03-09 7:21 ` Balaji Rao
2008-03-09 10:49 ` Mikael Pettersson [this message]
2008-03-10 17:20 ` Greg KH
2008-03-10 15:52 ` Greg KH
2008-03-10 16:05 ` Balaji Rao
2008-03-10 17:20 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18387.49334.235230.751065@harpo.it.uu.se \
--to=mikpe@it.uu.se \
--cc=balajirrao@gmail.com \
--cc=gregkh@suse.de \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®