[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190430150811.4hzhtz4w46o6numh@pathway.suse.cz>
Date: Tue, 30 Apr 2019 17:08:11 +0200
From: Petr Mladek <pmladek@...e.com>
To: "Tobin C. Harding" <tobin@...nel.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joe Lawrence <joe.lawrence@...hat.com>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] livepatch: Use correct kobject cleanup function
On Tue 2019-04-30 10:15:34, Tobin C. Harding wrote:
> The correct cleanup function after a call to kobject_init_and_add() has
> succeeded is kobject_del() _not_ kobject_put(). kobject_del() calls
> kobject_put().
Really? I see only kobject_put(kobj->parent) in kobject_del.
It decreases a reference of the _parent_ object and not
the given one.
Also the section "Kobject removal" in Documentation/kobject.txt
says that kobject_del() is for two-stage removal. kobject_put()
still needs to get called at a later time.
IMHO, this patch causes that kobject_put() would never get called.
That said, we could probably make the removal a bit cleaner
by using kobject_del() in klp_free_patch_start() and
kobject_put() in klp_free_patch_finish(). But I have
to think more about it.
Best Regards,
Petr
Powered by blists - more mailing lists