lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Jan 2008 09:51:06 -0800
From:	Greg KH <gregkh@...e.de>
To:	Dave Young <hidave.darkstar@...il.com>
Cc:	linux-kernel@...r.kernel.org, Kay Sievers <kay.sievers@...y.org>,
	Miklos Szeredi <miklos@...redi.hu>
Subject: Re: [PATCH 044/196] kset: add kset_create_and_add function

On Fri, Jan 25, 2008 at 05:09:41PM +0800, Dave Young wrote:
> On Jan 25, 2008 3:09 PM, Greg Kroah-Hartman <gregkh@...e.de> wrote:
> > +/**
> > + * kset_create_and_add - create a struct kset dynamically and add it to sysfs
> > + *
> > + * @name: the name for the kset
> > + * @uevent_ops: a struct kset_uevent_ops for the kset
> > + * @parent_kobj: the parent kobject of this kset, if any.
> > + *
> > + * This function creates a kset structure dynamically and registers it
> > + * with sysfs.  When you are finished with this structure, call
> > + * kset_unregister() and the structure will be dynamically freed when it
> > + * is no longer being used.
> > + *
> > + * If the kset was not able to be created, NULL will be returned.
> > + */
> > +struct kset *kset_create_and_add(const char *name,
> > +                                struct kset_uevent_ops *uevent_ops,
> > +                                struct kobject *parent_kobj)
> > +{
> > +       struct kset *kset;
> > +       int error;
> > +
> > +       kset = kset_create(name, uevent_ops, parent_kobj);
> > +       if (!kset)
> > +               return NULL;
> > +       error = kset_register(kset);
> > +       if (error) {
> > +               kfree(kset);
> 
> How about : kobject_put(&kset->kobj);

At this point in the object's lifetime, it is the same exact thing.

So both are correct :)

thanks,

greg k-h
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ