summaryrefslogtreecommitdiffstats
path: root/samples/livepatch/livepatch-callbacks-demo.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/livepatch/livepatch-callbacks-demo.c')
-rw-r--r--samples/livepatch/livepatch-callbacks-demo.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/samples/livepatch/livepatch-callbacks-demo.c b/samples/livepatch/livepatch-callbacks-demo.c
index 72f9e6d1387b..62d97953ad02 100644
--- a/samples/livepatch/livepatch-callbacks-demo.c
+++ b/samples/livepatch/livepatch-callbacks-demo.c
@@ -195,22 +195,11 @@ static struct klp_patch patch = {
static int livepatch_callbacks_demo_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_callbacks_demo_exit(void)
{
- WARN_ON(klp_unregister_patch(&patch));
}
module_init(livepatch_callbacks_demo_init);