[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071129103907.0b404071@gondolin.boeblingen.de.ibm.com>
Date: Thu, 29 Nov 2007 10:39:07 +0100
From: Cornelia Huck <cornelia.huck@...ibm.com>
To: Greg KH <greg@...ah.com>
Cc: linux-kernel@...r.kernel.org, Kay Sievers <kay.sievers@...y.org>,
Alan Stern <stern@...land.harvard.edu>,
Jonathan Corbet <corbet@....net>,
Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [RFC] Sample kset/ktype/kobject implementation
On Wed, 28 Nov 2007 22:11:39 -0800,
Greg KH <greg@...ah.com> wrote:
> > > foo->kobj.kset = example_kset;
> > > foo->kobj.ktype = &foo_ktype;
> > >
> > > /*
> > > * Register the kobject with the kernel, all the default files will
> > > * be created here and the uevent will be sent out. If we were to
> > > * call kobject_init() and then kobject_add() we would be
> > > * responsible for sending out the initial KOBJ_ADD uevent.
> > > */
> > > retval = kobject_register(&foo->kobj);
> > > if (retval) {
> > > kfree(foo);
> >
> > kobject_put(foo) is needed since it gets you through kobject_cleanup()
> > where the name can be freed.
>
> No, kobject_register() should have handled that for us, right?
kobject_register() doesn't do a kobject_put() if kobject_add() failed.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists