aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/samples/livepatch/livepatch-shadow-fix1.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/livepatch/livepatch-shadow-fix1.c')
-rw-r--r--samples/livepatch/livepatch-shadow-fix1.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/samples/livepatch/livepatch-shadow-fix1.c b/samples/livepatch/livepatch-shadow-fix1.c
index e8f1bd6b29b1..a5a5cac21d4d 100644
--- a/samples/livepatch/livepatch-shadow-fix1.c
+++ b/samples/livepatch/livepatch-shadow-fix1.c
@@ -157,25 +157,13 @@ static struct klp_patch patch = {
static int livepatch_shadow_fix1_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_shadow_fix1_exit(void)
{
/* Cleanup any existing SV_LEAK shadow variables */
klp_shadow_free_all(SV_LEAK, livepatch_fix1_dummy_leak_dtor);
-
- WARN_ON(klp_unregister_patch(&patch));
}
module_init(livepatch_shadow_fix1_init);