Skip to content

Commit

Permalink
[squash] livepatch: rebase the annotated sample
Browse files Browse the repository at this point in the history
Note: squash with ("livepatch: Add sample livepatch module")

commit 958ef1e ("livepatch: Simplify API by removing registration
step") removed klp_register_patch(), klp_unregister_patch(), and
klp_disable_patch(), so rebase the sample module accordingly.

[joe: rebase for v5.0]

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
  • Loading branch information
joe-lawrence committed Mar 18, 2019
1 parent 7d9878e commit fc04952
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions samples/livepatch/livepatch-annotated-sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,11 @@ static struct klp_patch patch = {

static int livepatch_init(void)
{
int ret;

ret = klp_register_patch(&patch);
if (ret)
return ret;
ret = klp_enable_patch(&patch);
if (ret) {
WARN_ON(klp_unregister_patch(&patch));
return ret;
}
return 0;
return klp_enable_patch(&patch);
}

static void livepatch_exit(void)
{
WARN_ON(klp_unregister_patch(&patch));
}

module_init(livepatch_init);
Expand Down

0 comments on commit fc04952

Please sign in to comment.