From: Greg KH <greg@kroah.com>
To: Arthur Jones <ajones@riverbed.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Doug Thompson <norsk5@yahoo.com>,
"bluesmoke-devel@lists.sourceforge.net"
<bluesmoke-devel@lists.sourceforge.net>
Subject: Re: on static kobjects and double frees...
Date: Tue, 10 Jun 2008 09:42:41 -0700 [thread overview]
Message-ID: <20080610164241.GA13928@kroah.com> (raw)
In-Reply-To: <20080610163800.GA28572@ajones-laptop.nbttech.com>
On Tue, Jun 10, 2008 at 09:38:00AM -0700, Arthur Jones wrote:
> Hi Greg, ...
>
> On Tue, Jun 10, 2008 at 09:23:41AM -0700, Greg KH wrote:
> > On Tue, Jun 10, 2008 at 08:58:50AM -0700, Arthur Jones wrote:
> > > Hi Greg, The edac pci sysfs generic layer uses a static
> > > kobject as a placeholder parent where edac pci drivers
> > > are inserted.
> >
> > Hm, stop right there.
> >
> > kobjects are not supposed to be static, bad things happen if you do that
> > (including the kernel itself will warn you about them, unless you gave
> > it an empty release function, and if so, then see
> > Documentation/kobject.txt and prepare to be mocked...)
>
> OK, I wondered about this, but I didn't see anything
> in Documentation/kobject.txt that said that kobjects
> can not be static. But now that I've fixed the double
> free bug, I'm seeing the warning you mentioned above...
Hm, there is the following text in that file:
Because kobjects are dynamic, they must not be declared
statically or on the stack, but instead, always allocated
dynamically. Future versions of the kernel will contain a
run-time check for kobjects that are created statically and will
warn the developer of this improper usage.
> I don't know how the current code came to be, so I
> can't speak to your issues below. But, with these
> pointers, I think I can get things cleaned up properly.
Great, if you want me to review it, I'd be glad to do so.
thanks,
greg k-h
next prev parent reply other threads:[~2008-06-10 16:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 15:58 Arthur Jones
2008-06-10 16:23 ` Greg KH
2008-06-10 16:38 ` Arthur Jones
2008-06-10 16:42 ` Greg KH [this message]
2008-06-10 16:58 ` Arthur Jones
2008-06-10 21:14 ` Doug Thompson
2008-06-10 21:39 ` Arthur Jones
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=20080610164241.GA13928@kroah.com \
--to=greg@kroah.com \
--cc=ajones@riverbed.com \
--cc=bluesmoke-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=norsk5@yahoo.com \
/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®