All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: eran liberty <eran.liberty@gmail.com>
Cc: balajirrao@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: kobjects: mark cleaned up kobjects as unitialized
Date: Wed, 25 Nov 2009 04:35:34 -0800	[thread overview]
Message-ID: <20091125123534.GA17486@suse.de> (raw)
In-Reply-To: <ffc2b1d40911250127x7b3c3609qb99820d212a7a0ad@mail.gmail.com>

On Wed, Nov 25, 2009 at 11:27:58AM +0200, eran liberty wrote:
> Hi Greg & Balaji,
> 
> After diving into the LDKM and failed to spot the point where you
> actually un-initialize the 'state_initialized' of a kobject... and
> since I have statically allocated object which trip over this very
> same trap...

Ah, there's your problem, don't statically allocate a kobject.  Fix that
and your issue goes away, right?

> Google-ing for others who fell into this trap, I found your thread/patch at:
> http://lkml.org/lkml/2008/3/8/155
> and
> http://lkml.indiana.edu/hypermail/linux/kernel/0902.0/01969.html
> 
> I noticed this patch did not make it into the mainline.
> 
> Is this patch still valid?
> Is there some other, better way to do it by the book?

Do not statically allocate a kobject.

> Right now I by-pass the problem by memset-ing the whole object after I
> release it... but I feel this is a bit brutal.

You should be freeing your memory in your release function.

Do you have a pointer to your code somewhere?

thanks,

greg k-h

  reply	other threads:[~2009-11-25 12:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25  9:27 kobjects: mark cleaned up kobjects as unitialized eran liberty
2009-11-25 12:35 ` Greg KH [this message]
2009-11-25 14:27   ` eran liberty
2009-11-25 15:27     ` Greg KH
2009-11-25 15:41       ` 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=20091125123534.GA17486@suse.de \
    --to=gregkh@suse.de \
    --cc=balajirrao@gmail.com \
    --cc=eran.liberty@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.