Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-14 Thread Josh Poimboeuf
On Fri, Dec 14, 2018 at 10:32:01AM +0100, Petr Mladek wrote: > On Thu 2018-12-13 16:10:37, Josh Poimboeuf wrote: > > On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: > > > +static void klp_free_funcs(struct klp_object *obj) > > > { > > > struct klp_func *func; > > > > > > - for (fu

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-14 Thread Miroslav Benes
On Thu, 13 Dec 2018, Josh Poimboeuf wrote: > On Mon, Dec 03, 2018 at 03:59:57PM +0100, Miroslav Benes wrote: > > On Thu, 29 Nov 2018, Petr Mladek wrote: > > > > > -static int klp_init_patch(struct klp_patch *patch) > > > +/* Init operations that must succeed before klp_free_patch() can be > > >

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-14 Thread Petr Mladek
On Thu 2018-12-13 16:10:37, Josh Poimboeuf wrote: > On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: > > +static void klp_free_funcs(struct klp_object *obj) > > { > > struct klp_func *func; > > > > - for (func = obj->funcs; func->old_name && func != limit; func++) > > -

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-13 Thread Josh Poimboeuf
On Mon, Dec 03, 2018 at 03:59:57PM +0100, Miroslav Benes wrote: > On Thu, 29 Nov 2018, Petr Mladek wrote: > > > -static int klp_init_patch(struct klp_patch *patch) > > +/* Init operations that must succeed before klp_free_patch() can be > > called. */ > > +static int klp_init_patch_before_free(st

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-13 Thread Josh Poimboeuf
On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: > +static void klp_free_funcs(struct klp_object *obj) > { > struct klp_func *func; > > - for (func = obj->funcs; func->old_name && func != limit; func++) > - kobject_put(&func->kobj); > + klp_for_each_func(obj

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-06 Thread Joe Lawrence
On 12/06/2018 03:15 AM, Petr Mladek wrote: > On Wed 2018-12-05 14:02:20, Joe Lawrence wrote: >> On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: >>> The code for freeing livepatch structures is a bit scattered and tricky: >>> >>> [ ... snip ... ] >>> >>> +static int klp_init_patch(struc

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-06 Thread Petr Mladek
On Wed 2018-12-05 14:02:20, Joe Lawrence wrote: > On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: > > The code for freeing livepatch structures is a bit scattered and tricky: > > > > [ ... snip ... ] > > > > +static int klp_init_patch(struct klp_patch *patch) > > +{ > > + struct klp

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-05 Thread Joe Lawrence
On Thu, Nov 29, 2018 at 10:44:23AM +0100, Petr Mladek wrote: > The code for freeing livepatch structures is a bit scattered and tricky: > > + direct calls to klp_free_*_limited() and kobject_put() are > used to release partially initialized objects > > + klp_free_patch() removes the patch

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-04 Thread Petr Mladek
On Mon 2018-12-03 15:59:57, Miroslav Benes wrote: > On Thu, 29 Nov 2018, Petr Mladek wrote: > > > -static int klp_init_patch(struct klp_patch *patch) > > +/* Init operations that must succeed before klp_free_patch() can be > > called. */ > > +static int klp_init_patch_before_free(struct klp_patch

Re: [PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-12-03 Thread Miroslav Benes
On Thu, 29 Nov 2018, Petr Mladek wrote: > -static int klp_init_patch(struct klp_patch *patch) > +/* Init operations that must succeed before klp_free_patch() can be called. > */ > +static int klp_init_patch_before_free(struct klp_patch *patch) There is no klp_free_patch() now, so the comment is

[PATCH v14 03/11] livepatch: Consolidate klp_free functions

2018-11-29 Thread Petr Mladek
The code for freeing livepatch structures is a bit scattered and tricky: + direct calls to klp_free_*_limited() and kobject_put() are used to release partially initialized objects + klp_free_patch() removes the patch from the public list and releases all objects except for patch->kobj